com.netflix.astyanax
Class ThreadLocalMutationBatchManager

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

public class ThreadLocalMutationBatchManager
extends java.lang.Object
implements MutationBatchManager

Simple mutation batch using thread local storage to keeps track of one mutation per thread


Constructor Summary
ThreadLocalMutationBatchManager(Keyspace keyspace, ConsistencyLevel cl)
           
ThreadLocalMutationBatchManager(Keyspace keyspace, ConsistencyLevel cl, com.netflix.astyanax.retry.RetryPolicy retryPolicy)
           
 
Method Summary
 void commitSharedMutationBatch()
          Commit all mutations on the batch
 void discard()
          Discard all mutations on the batch
 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

ThreadLocalMutationBatchManager

public ThreadLocalMutationBatchManager(Keyspace keyspace,
                                       ConsistencyLevel cl)

ThreadLocalMutationBatchManager

public ThreadLocalMutationBatchManager(Keyspace keyspace,
                                       ConsistencyLevel cl,
                                       com.netflix.astyanax.retry.RetryPolicy retryPolicy)
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:

getNewMutationBatch

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

Specified by:
getNewMutationBatch in interface MutationBatchManager
Returns:

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