com.netflix.astyanax
Class MultiMutationBatchManager

java.lang.Object
  extended by com.netflix.astyanax.MultiMutationBatchManager
All Implemented Interfaces:
MutationBatchManager

public class MultiMutationBatchManager
extends java.lang.Object
implements MutationBatchManager

Extension to mutation batch which allows for multiple 'named' mutation batches. The purpose of this manager is to allow mutations to be executed in order of batch creation so that subsequent mutations aren't attempted if there is a failure.


Constructor Summary
MultiMutationBatchManager(Keyspace keyspace, ConsistencyLevel cl)
           
 
Method Summary
 void commitSharedMutationBatch()
          Commit all mutations on the batch
 void discard()
          Discard all mutations on the batch
 MutationBatch getNamedMutationBatch(java.lang.String name)
           
 MutationBatch getNewMutationBatch()
          Get a one time mutation batch
 MutationBatch getSharedMutationBatch()
          Get or create a new mutation batch.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiMutationBatchManager

public MultiMutationBatchManager(Keyspace keyspace,
                                 ConsistencyLevel cl)
Method Detail

getSharedMutationBatch

public MutationBatch getSharedMutationBatch()
Description copied from interface: MutationBatchManager
Get or create a new mutation batch.

Specified by:
getSharedMutationBatch in interface MutationBatchManager
Returns:

getNamedMutationBatch

public MutationBatch getNamedMutationBatch(java.lang.String name)

commitSharedMutationBatch

public void commitSharedMutationBatch()
                               throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
Description copied from interface: MutationBatchManager
Commit all mutations on the batch

Specified by:
commitSharedMutationBatch in interface MutationBatchManager
Throws:
com.netflix.astyanax.connectionpool.exceptions.ConnectionException

discard

public void discard()
Description copied from interface: MutationBatchManager
Discard all mutations on the batch

Specified by:
discard in interface MutationBatchManager

getNewMutationBatch

public MutationBatch getNewMutationBatch()
Description copied from interface: MutationBatchManager
Get a one time mutation batch

Specified by:
getNewMutationBatch in interface MutationBatchManager
Returns: