me.prettyprint.cassandra.service
Class BatchMutation<K>

java.lang.Object
  extended by me.prettyprint.cassandra.service.BatchMutation<K>

public final class BatchMutation<K>
extends Object

A BatchMutation object is used to construct the KeyspaceService.batchMutate(BatchMutation) call. A BatchMutation encapsulates a set of updates (or insertions) and deletions all submitted at the same time to cassandra. The BatchMutation object is useful for user friendly construction of the thrift call batch_mutate.

Author:
Ran Tavory (rantan@outbrain.com), Nathan McCall (nate@riptano.com), Patricio Echague (patricioe@gmail.com)

Constructor Summary
BatchMutation(Serializer<K> serializer)
           
BatchMutation(Serializer<K> serializer, BatchSizeHint sizeHint)
           
 
Method Summary
 BatchMutation<K> addCounterInsertion(K key, List<String> columnFamilies, org.apache.cassandra.thrift.CounterColumn counterColumn)
          Add a ColumnCounter insertion (or update)
 BatchMutation<K> addDeletion(K key, List<String> columnFamilies, org.apache.cassandra.thrift.Deletion deletion)
          Add a deletion request to the batch mutation.
 BatchMutation<K> addInsertion(K key, List<String> columnFamilies, org.apache.cassandra.thrift.Column column)
          Add an Column insertion (or update) to the batch mutation request.
 BatchMutation<K> addSuperCounterInsertion(K key, List<String> columnFamilies, org.apache.cassandra.thrift.CounterSuperColumn counterSuperColumn)
          Add a SuperColumnCounter insertion (or update)
 BatchMutation<K> addSuperInsertion(K key, List<String> columnFamilies, org.apache.cassandra.thrift.SuperColumn superColumn)
          Add a SuperColumn insertion (or update) to the batch mutation request.
 boolean isEmpty()
          Checks whether the mutation object contains any mutations.
 BatchMutation<K> makeCopy()
          Makes a shallow copy of the mutation object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatchMutation

public BatchMutation(Serializer<K> serializer,
                     BatchSizeHint sizeHint)

BatchMutation

public BatchMutation(Serializer<K> serializer)
Method Detail

addInsertion

public BatchMutation<K> addInsertion(K key,
                                     List<String> columnFamilies,
                                     org.apache.cassandra.thrift.Column column)
Add an Column insertion (or update) to the batch mutation request.


addSuperInsertion

public BatchMutation<K> addSuperInsertion(K key,
                                          List<String> columnFamilies,
                                          org.apache.cassandra.thrift.SuperColumn superColumn)
Add a SuperColumn insertion (or update) to the batch mutation request.


addCounterInsertion

public BatchMutation<K> addCounterInsertion(K key,
                                            List<String> columnFamilies,
                                            org.apache.cassandra.thrift.CounterColumn counterColumn)
Add a ColumnCounter insertion (or update)


addSuperCounterInsertion

public BatchMutation<K> addSuperCounterInsertion(K key,
                                                 List<String> columnFamilies,
                                                 org.apache.cassandra.thrift.CounterSuperColumn counterSuperColumn)
Add a SuperColumnCounter insertion (or update)


addDeletion

public BatchMutation<K> addDeletion(K key,
                                    List<String> columnFamilies,
                                    org.apache.cassandra.thrift.Deletion deletion)
Add a deletion request to the batch mutation.


makeCopy

public BatchMutation<K> makeCopy()
Makes a shallow copy of the mutation object.

Returns:

isEmpty

public boolean isEmpty()
Checks whether the mutation object contains any mutations.

Returns:


Copyright © 2011. All Rights Reserved.