voldemort.server.protocol.admin
Class UpdatePartitionEntriesStreamRequestHandler
java.lang.Object
voldemort.server.protocol.admin.UpdatePartitionEntriesStreamRequestHandler
- All Implemented Interfaces:
- StreamRequestHandler
- Direct Known Subclasses:
- TimeBasedUpdatePartitionEntriesStreamRequestHandler
public class UpdatePartitionEntriesStreamRequestHandler
- extends java.lang.Object
- implements StreamRequestHandler
UpdatePartitionEntriesStreamRequestHandler implements the streaming logic for
updating partition entries.
This is the base class, which abstracts network IO to get an entry off the
wire, and provides a hook
processEntry(ByteArray, Versioned)
to implement custom logic (if needed) to manage how the entry will be written
to storage.
The default implementation of processEntry(..) simply issues a storage engine
put.
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
request
protected VAdminProto.UpdatePartitionEntriesRequest request
responseBuilder
protected final VAdminProto.UpdatePartitionEntriesResponse.Builder responseBuilder
errorCodeMapper
protected final ErrorCodeMapper errorCodeMapper
throttler
protected final EventThrottler throttler
filter
protected final VoldemortFilter filter
storageEngine
protected final StorageEngine<ByteArray,byte[],byte[]> storageEngine
counter
protected int counter
startTime
protected final long startTime
streamStats
protected final StreamingStats streamStats
logger
protected final org.apache.log4j.Logger logger
isBatchWriteOff
protected java.util.concurrent.atomic.AtomicBoolean isBatchWriteOff
UpdatePartitionEntriesStreamRequestHandler
public UpdatePartitionEntriesStreamRequestHandler(VAdminProto.UpdatePartitionEntriesRequest request,
ErrorCodeMapper errorCodeMapper,
VoldemortConfig voldemortConfig,
StorageEngine<ByteArray,byte[],byte[]> storageEngine,
StoreRepository storeRepository,
NetworkClassLoader networkClassLoader)
handleRequest
public StreamRequestHandler.StreamRequestHandlerState handleRequest(java.io.DataInputStream inputStream,
java.io.DataOutputStream outputStream)
throws java.io.IOException
- Description copied from interface:
StreamRequestHandler
- Handles a "segment" of a streaming request.
- Specified by:
handleRequest
in interface StreamRequestHandler
- Returns:
StreamRequestHandler.StreamRequestHandlerState
- Throws:
java.io.IOException
getDirection
public StreamRequestHandler.StreamRequestDirection getDirection()
- Specified by:
getDirection
in interface StreamRequestHandler
close
public void close(java.io.DataOutputStream outputStream)
throws java.io.IOException
- Specified by:
close
in interface StreamRequestHandler
- Throws:
java.io.IOException
handleError
public void handleError(java.io.DataOutputStream outputStream,
VoldemortException e)
throws java.io.IOException
- Specified by:
handleError
in interface StreamRequestHandler
- Throws:
java.io.IOException
finalize
protected void finalize()
- Overrides:
finalize
in class java.lang.Object
processEntry
protected void processEntry(ByteArray key,
Versioned<byte[]> value)
throws java.io.IOException
- Throws:
java.io.IOException
getHandlerName
protected java.lang.String getHandlerName()
Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu