Search in sources :

Example 26 with ConditionalMutation

use of org.apache.accumulo.core.data.ConditionalMutation 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

ConditionalMutation (org.apache.accumulo.core.data.ConditionalMutation)26 ConditionalWriter (org.apache.accumulo.core.client.ConditionalWriter)24 ConditionalWriterConfig (org.apache.accumulo.core.client.ConditionalWriterConfig)22 Condition (org.apache.accumulo.core.data.Condition)21 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 Value (org.apache.accumulo.core.data.Value)11 Status (org.apache.accumulo.core.client.ConditionalWriter.Status)10 Key (org.apache.accumulo.core.data.Key)9 Range (org.apache.accumulo.core.data.Range)8 Text (org.apache.hadoop.io.Text)8 AccumuloException (org.apache.accumulo.core.client.AccumuloException)7 Authorizations (org.apache.accumulo.core.security.Authorizations)7 ArrayList (java.util.ArrayList)6 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)6 IteratorSetting (org.apache.accumulo.core.client.IteratorSetting)5 TableNotFoundException (org.apache.accumulo.core.client.TableNotFoundException)5