Search in sources :

Example 1 with VirtualMutation

use of org.apache.cassandra.db.virtual.VirtualMutation in project cassandra by apache.

the class SingleTableUpdatesCollector method toMutations.

/**
 * Returns a collection containing all the mutations.
 * @return a collection containing all the mutations.
 */
public List<IMutation> toMutations() {
    List<IMutation> ms = new ArrayList<>(puBuilders.size());
    for (PartitionUpdate.Builder builder : puBuilders.values()) {
        IMutation mutation;
        if (metadata.isVirtual())
            mutation = new VirtualMutation(builder.build());
        else if (metadata.isCounter())
            mutation = new CounterMutation(new Mutation(builder.build()), counterConsistencyLevel);
        else
            mutation = new Mutation(builder.build());
        mutation.validateIndexedColumns();
        ms.add(mutation);
    }
    return ms;
}
Also used : CounterMutation(org.apache.cassandra.db.CounterMutation) IMutation(org.apache.cassandra.db.IMutation) VirtualMutation(org.apache.cassandra.db.virtual.VirtualMutation) ArrayList(java.util.ArrayList) CounterMutation(org.apache.cassandra.db.CounterMutation) VirtualMutation(org.apache.cassandra.db.virtual.VirtualMutation) Mutation(org.apache.cassandra.db.Mutation) IMutation(org.apache.cassandra.db.IMutation) PartitionUpdate(org.apache.cassandra.db.partitions.PartitionUpdate)

Aggregations

ArrayList (java.util.ArrayList)1 CounterMutation (org.apache.cassandra.db.CounterMutation)1 IMutation (org.apache.cassandra.db.IMutation)1 Mutation (org.apache.cassandra.db.Mutation)1 PartitionUpdate (org.apache.cassandra.db.partitions.PartitionUpdate)1 VirtualMutation (org.apache.cassandra.db.virtual.VirtualMutation)1