Search in sources :

Example 26 with ConditionalWriter

use of org.apache.accumulo.core.client.ConditionalWriter in project accumulo by apache.

the class SessionDurabilityIT method conditionWriteSome.

private void conditionWriteSome(String tableName, int n, ConditionalWriterConfig cfg) throws Exception {
    Connector c = getConnector();
    ConditionalWriter cw = c.createConditionalWriter(tableName, cfg);
    for (int i = 0; i < n; i++) {
        ConditionalMutation m = new ConditionalMutation(i + "", new Condition("", ""));
        m.put("", "", "X");
        assertEquals(Status.ACCEPTED, cw.write(m).getStatus());
    }
}
Also used : Condition(org.apache.accumulo.core.data.Condition) Connector(org.apache.accumulo.core.client.Connector) ConditionalWriter(org.apache.accumulo.core.client.ConditionalWriter) ConditionalMutation(org.apache.accumulo.core.data.ConditionalMutation)

Aggregations

ConditionalWriter (org.apache.accumulo.core.client.ConditionalWriter)26 ConditionalMutation (org.apache.accumulo.core.data.ConditionalMutation)24 ConditionalWriterConfig (org.apache.accumulo.core.client.ConditionalWriterConfig)23 Condition (org.apache.accumulo.core.data.Condition)20 Connector (org.apache.accumulo.core.client.Connector)19 Test (org.junit.Test)18 Result (org.apache.accumulo.core.client.ConditionalWriter.Result)12 IsolatedScanner (org.apache.accumulo.core.client.IsolatedScanner)12 Scanner (org.apache.accumulo.core.client.Scanner)12 Status (org.apache.accumulo.core.client.ConditionalWriter.Status)10 Value (org.apache.accumulo.core.data.Value)10 Key (org.apache.accumulo.core.data.Key)9 AccumuloException (org.apache.accumulo.core.client.AccumuloException)8 Range (org.apache.accumulo.core.data.Range)8 Text (org.apache.hadoop.io.Text)8 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)7 Authorizations (org.apache.accumulo.core.security.Authorizations)7 TableNotFoundException (org.apache.accumulo.core.client.TableNotFoundException)6 ArrayList (java.util.ArrayList)5 IteratorSetting (org.apache.accumulo.core.client.IteratorSetting)5