Search in sources :

Example 11 with MutationsRejectedException

use of org.apache.accumulo.core.client.MutationsRejectedException in project apex-malhar by apache.

the class AccumuloWindowStore method storeCommittedWindowId.

@Override
public void storeCommittedWindowId(String appId, int operatorId, long windowId) {
    byte[] WindowIdBytes = toBytes(windowId);
    String columnKey = appId + "_" + operatorId + "_" + lastWindowColumnName;
    lastWindowColumnBytes = columnKey.getBytes();
    Mutation mutation = new Mutation(rowBytes);
    mutation.put(columnFamilyBytes, lastWindowColumnBytes, WindowIdBytes);
    try {
        batchwriter.addMutation(mutation);
        batchwriter.flush();
    } catch (MutationsRejectedException e) {
        logger.error("error getting committed window id", e);
        DTThrowable.rethrow(e);
    }
}
Also used : Mutation(org.apache.accumulo.core.data.Mutation) MutationsRejectedException(org.apache.accumulo.core.client.MutationsRejectedException)

Example 12 with MutationsRejectedException

use of org.apache.accumulo.core.client.MutationsRejectedException in project apex-malhar by apache.

the class AbstractAccumuloOutputOperator method storeAggregate.

@Override
public void storeAggregate() {
    try {
        for (T tuple : tuples) {
            Mutation mutation = operationMutation(tuple);
            store.getBatchwriter().addMutation(mutation);
        }
        store.getBatchwriter().flush();
    } catch (MutationsRejectedException e) {
        logger.error("unable to write mutations", e);
        DTThrowable.rethrow(e);
    }
    tuples.clear();
}
Also used : Mutation(org.apache.accumulo.core.data.Mutation) MutationsRejectedException(org.apache.accumulo.core.client.MutationsRejectedException)

Aggregations

MutationsRejectedException (org.apache.accumulo.core.client.MutationsRejectedException)12 Mutation (org.apache.accumulo.core.data.Mutation)8 PrestoException (com.facebook.presto.spi.PrestoException)5 BatchWriter (org.apache.accumulo.core.client.BatchWriter)3 TableNotFoundException (org.apache.accumulo.core.client.TableNotFoundException)3 Value (org.apache.accumulo.core.data.Value)3 IOException (java.io.IOException)2 AtomicLong (java.util.concurrent.atomic.AtomicLong)2 BatchWriterConfig (org.apache.accumulo.core.client.BatchWriterConfig)2 Key (org.apache.accumulo.core.data.Key)2 ColumnVisibility (org.apache.accumulo.core.security.ColumnVisibility)2 Row (com.facebook.presto.accumulo.model.Row)1 Type (com.facebook.presto.spi.type.Type)1 VarcharType (com.facebook.presto.spi.type.VarcharType)1 Entry (java.util.Map.Entry)1 IsolatedScanner (org.apache.accumulo.core.client.IsolatedScanner)1 IteratorSetting (org.apache.accumulo.core.client.IteratorSetting)1 RowIterator (org.apache.accumulo.core.client.RowIterator)1 Scanner (org.apache.accumulo.core.client.Scanner)1 SortedKeyIterator (org.apache.accumulo.core.iterators.SortedKeyIterator)1