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

java.lang.Object
  extended by voldemort.store.routed.PipelineData<K,V>
Type Parameters:
K - Type for the key used in the request
V - Type for the value returned by the call
Direct Known Subclasses:
BasicPipelineData, GetAllPipelineData

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

PipelineData includes a common set of data that is used to represent the state within the Pipeline as it moves from action to action. There's a one-to-one correspondence between a Pipeline and PipelineData, though the latter is not included as an instance variable. Action implementations usually include the PipelineData as an instance variable upon creation. It's basically a POJO that includes some relevant state for the pipeline execution: There are some subclasses of PipelineData that are used to handle the different types of operations:

  1. BasicPipelineData - used by most operations; includes a list of Node instances relevant to the key in the operation among other values
  2. GetAllPipelineData - used by the "get all" operation specifically, due to the fact that it includes Map data structures which don't fit in well in the generic structure
  3. PutPipelineData - used only by the "put" operation as it includes data specific to that operation

See Also:
Pipeline, PipelineData, BasicPipelineData, GetAllPipelineData, PutPipelineData

Field Summary
protected  java.util.List<Node> failedNodes
           
protected  java.util.List<java.lang.Exception> failures
           
protected  VoldemortException fatalError
           
protected  java.util.List<Node> replicationSet
           
protected  PipelineRoutedStats stats
           
protected  java.lang.String storeName
           
 
Constructor Summary
PipelineData()
           
 
Method Summary
 void addFailedNode(Node node)
           
 java.util.List<Node> getFailedNodes()
           
 java.util.List<java.lang.Exception> getFailures()
          Returns a list of zero or more errors that occurred while attempting to contact the remote Voldemort node.
 VoldemortException getFatalError()
          Returns a "fatal" error that occurred while attempting to contact the remote Voldemort nodes.
 java.util.List<Node> getReplicationSet()
           
 java.util.List<Response<K,V>> getResponses()
          Returns is a list of responses that are received by requests to remote Voldemort nodes, either synchronous or asynchronous.
 java.lang.String getStoreName()
           
 void recordFailure(java.lang.Exception e)
          Adds an error to the list errors that occurred while attempting to contact the remote Voldemort node.
 void reportException(java.lang.Exception e)
           
 void setFatalError(VoldemortException fatalError)
           
 void setReplicationSet(java.util.List<Node> replicationSet)
           
 void setStats(PipelineRoutedStats stats)
           
 void setStoreName(java.lang.String storeName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

failures

protected final java.util.List<java.lang.Exception> failures

fatalError

protected VoldemortException fatalError

storeName

protected volatile java.lang.String storeName

failedNodes

protected final java.util.List<Node> failedNodes

replicationSet

protected java.util.List<Node> replicationSet

stats

protected PipelineRoutedStats stats
Constructor Detail

PipelineData

public PipelineData()
Method Detail

setStats

public void setStats(PipelineRoutedStats stats)

getReplicationSet

public java.util.List<Node> getReplicationSet()

setReplicationSet

public void setReplicationSet(java.util.List<Node> replicationSet)

getResponses

public java.util.List<Response<K,V>> getResponses()
Returns is a list of responses that are received by requests to remote Voldemort nodes, either synchronous or asynchronous.

Returns:
List of Response instances

getFatalError

public VoldemortException getFatalError()
Returns a "fatal" error that occurred while attempting to contact the remote Voldemort nodes.

If a hard error occurs, fatalError will be populated and the Pipeline.Event.COMPLETED event will be pushed onto the Pipeline event stack.

Returns:
VoldemortException, or null if no fatal error occurred during processing

setFatalError

public void setFatalError(VoldemortException fatalError)

getFailures

public java.util.List<java.lang.Exception> getFailures()
Returns a list of zero or more errors that occurred while attempting to contact the remote Voldemort node.

Returns:
List of non-fatal exceptions

recordFailure

public void recordFailure(java.lang.Exception e)
Adds an error to the list errors that occurred while attempting to contact the remote Voldemort node.

Parameters:
e - Exception

addFailedNode

public void addFailedNode(Node node)

getFailedNodes

public java.util.List<Node> getFailedNodes()

getStoreName

public java.lang.String getStoreName()

setStoreName

public void setStoreName(java.lang.String storeName)

reportException

public void reportException(java.lang.Exception e)


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