voldemort.store.routed.action
Class AsyncPutSynchronizer

java.lang.Object
  extended by voldemort.store.routed.action.AsyncPutSynchronizer

public class AsyncPutSynchronizer
extends java.lang.Object

The AsyncPutSynchronizer Class is used for synchronizing operations inside PerformParallelPut action More specifically, it coordinate the exception handling and hinted handoff responsibility between master thread and async put threads


Constructor Summary
AsyncPutSynchronizer()
           
 
Method Summary
 void cutoffHandling()
          Master Stop accepting new responses (from async callbacks)
 void disallowDelegateSlop()
          Stop accepting delegated slop responsibility by master
 java.util.Set<Node> getDelegatedSlopDestinations()
          Get list of nodes to register slop for
 boolean responseQueueIsEmpty()
          to see if the response queue is empty
 Response<ByteArray,java.lang.Object> responseQueuePoll(long timeout, java.util.concurrent.TimeUnit timeUnit)
          poll the response queue for response
 boolean tryDelegateResponseHandling(Response<ByteArray,java.lang.Object> response)
          try to delegate the master to handle the response
 boolean tryDelegateSlop(Node node)
          Try to delegate the responsibility of sending slops to master
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncPutSynchronizer

public AsyncPutSynchronizer()
Method Detail

getDelegatedSlopDestinations

public java.util.Set<Node> getDelegatedSlopDestinations()
Get list of nodes to register slop for

Returns:
list of nodes to register slop for

disallowDelegateSlop

public void disallowDelegateSlop()
Stop accepting delegated slop responsibility by master


tryDelegateSlop

public boolean tryDelegateSlop(Node node)
Try to delegate the responsibility of sending slops to master

Parameters:
node - The node that slop should eventually be pushed to
Returns:
true if master accept the responsibility; false if master does not accept

cutoffHandling

public void cutoffHandling()
Master Stop accepting new responses (from async callbacks)


tryDelegateResponseHandling

public boolean tryDelegateResponseHandling(Response<ByteArray,java.lang.Object> response)
try to delegate the master to handle the response

Parameters:
response -
Returns:
true if the master accepted the response; false if the master didn't accept

responseQueuePoll

public Response<ByteArray,java.lang.Object> responseQueuePoll(long timeout,
                                                              java.util.concurrent.TimeUnit timeUnit)
                                                       throws java.lang.InterruptedException
poll the response queue for response

Parameters:
timeout - timeout amount
timeUnit - timeUnit of timeout
Returns:
same result of BlockQueue.poll(long, TimeUnit)
Throws:
java.lang.InterruptedException

responseQueueIsEmpty

public boolean responseQueueIsEmpty()
to see if the response queue is empty

Returns:
true is response queue is empty; false if not empty.


Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu