Search in sources :

Example 1 with TConditionalMutation

use of org.apache.accumulo.core.data.thrift.TConditionalMutation in project accumulo by apache.

the class ConditionalWriterImpl method convertMutations.

private void convertMutations(TabletServerMutations<QCMutation> mutations, Map<Long, CMK> cmidToCm, MutableLong cmid, Map<TKeyExtent, List<TConditionalMutation>> tmutations, CompressedIterators compressedIters) {
    for (Entry<KeyExtent, List<QCMutation>> entry : mutations.getMutations().entrySet()) {
        TKeyExtent tke = entry.getKey().toThrift();
        ArrayList<TConditionalMutation> tcondMutaions = new ArrayList<>();
        List<QCMutation> condMutations = entry.getValue();
        for (QCMutation cm : condMutations) {
            TMutation tm = cm.toThrift();
            List<TCondition> conditions = convertConditions(cm, compressedIters);
            cmidToCm.put(cmid.longValue(), new CMK(entry.getKey(), cm));
            TConditionalMutation tcm = new TConditionalMutation(conditions, tm, cmid.longValue());
            cmid.increment();
            tcondMutaions.add(tcm);
        }
        tmutations.put(tke, tcondMutaions);
    }
}
Also used : ArrayList(java.util.ArrayList) TKeyExtent(org.apache.accumulo.core.data.thrift.TKeyExtent) TConditionalMutation(org.apache.accumulo.core.data.thrift.TConditionalMutation) TKeyExtent(org.apache.accumulo.core.data.thrift.TKeyExtent) KeyExtent(org.apache.accumulo.core.data.impl.KeyExtent) TCondition(org.apache.accumulo.core.data.thrift.TCondition) List(java.util.List) ArrayList(java.util.ArrayList) TMutation(org.apache.accumulo.core.data.thrift.TMutation)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 KeyExtent (org.apache.accumulo.core.data.impl.KeyExtent)1 TCondition (org.apache.accumulo.core.data.thrift.TCondition)1 TConditionalMutation (org.apache.accumulo.core.data.thrift.TConditionalMutation)1 TKeyExtent (org.apache.accumulo.core.data.thrift.TKeyExtent)1 TMutation (org.apache.accumulo.core.data.thrift.TMutation)1