voldemort.store.routed
Class Response<K,V>

java.lang.Object
  extended by voldemort.store.routed.Response<K,V>
Type Parameters:
K - Type for the key used in the request
V - Type for the value returned by the call

public class Response<K,V>
extends java.lang.Object

Response represents a response from a call to a remote Voldemort node to perform some operation (get, put, etc.). It includes the Node and request time as these are needed by the FailureDetector that will be used by the user of the Response.

A Response is usually used in conjunction with asynchronous requests as a sort of callback mechanism, though this isn't always the case. In the case where they are the result of asynchronous requests, the NonblockingStore will invoke the NonblockingStoreCallback instances's requestComplete method which will in turn package up the data in a Response object that is sent to the Pipeline via an Pipeline.Event.RESPONSES_RECEIVED event.

Response instances are stored in the PipelineData to represent the responses to requests made during execution of the Pipeline.

This class uses generics for the value to support the return types used by the different operations. Oftentimes the key type is simply a ByteArray instance, but in the case of the "get all" operation, the key is actually an Iterable.

See Also:
NonblockingStore, NonblockingStoreCallback, Pipeline, PipelineData

Constructor Summary
Response(Node node, K key, V value, long requestTime)
           
 
Method Summary
 K getKey()
           
 Node getNode()
           
 long getRequestTime()
           
 V getValue()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Response

public Response(Node node,
                K key,
                V value,
                long requestTime)
Method Detail

getNode

public Node getNode()

getKey

public K getKey()

getValue

public V getValue()

getRequestTime

public long getRequestTime()


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