voldemort.server.protocol.admin
Class TimeBasedUpdatePartitionEntriesStreamRequestHandler

java.lang.Object
  extended by voldemort.server.protocol.admin.UpdatePartitionEntriesStreamRequestHandler
      extended by voldemort.server.protocol.admin.TimeBasedUpdatePartitionEntriesStreamRequestHandler
All Implemented Interfaces:
StreamRequestHandler

public class TimeBasedUpdatePartitionEntriesStreamRequestHandler
extends UpdatePartitionEntriesStreamRequestHandler

This class implements a streaming interface into a voldemort server, that resolves based on timestamp. Specifically, the policy implemented is "overwrite if later". That is, if (and only if), the streamed in version's timestamp is greater than the timestamps of ALL" versions on storage, the key is overwritten atomically with the streamed version. Else, the key is unmodified. NOTE: This class does not do any buffering like BufferedUpdatePartitionEntriesStreamRequestHandler since this is mainly intended to be used for streaming values in from external sources.


Nested Class Summary
 
Nested classes/interfaces inherited from interface voldemort.server.protocol.StreamRequestHandler
StreamRequestHandler.StreamRequestDirection, StreamRequestHandler.StreamRequestHandlerState
 
Field Summary
 
Fields inherited from class voldemort.server.protocol.admin.UpdatePartitionEntriesStreamRequestHandler
counter, errorCodeMapper, filter, isBatchWriteOff, logger, request, responseBuilder, startTime, storageEngine, streamStats, throttler
 
Fields inherited from interface voldemort.server.protocol.StreamRequestHandler
STAT_RECORDS_INTERVAL
 
Constructor Summary
TimeBasedUpdatePartitionEntriesStreamRequestHandler(VAdminProto.UpdatePartitionEntriesRequest request, ErrorCodeMapper errorCodeMapper, VoldemortConfig voldemortConfig, StorageEngine<ByteArray,byte[],byte[]> storageEngine, StoreRepository storeRepository, NetworkClassLoader networkClassLoader)
           
 
Method Summary
protected  java.lang.String getHandlerName()
           
protected  void processEntry(ByteArray key, Versioned<byte[]> value)
           
 
Methods inherited from class voldemort.server.protocol.admin.UpdatePartitionEntriesStreamRequestHandler
close, finalize, getDirection, handleError, handleRequest
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeBasedUpdatePartitionEntriesStreamRequestHandler

public TimeBasedUpdatePartitionEntriesStreamRequestHandler(VAdminProto.UpdatePartitionEntriesRequest request,
                                                           ErrorCodeMapper errorCodeMapper,
                                                           VoldemortConfig voldemortConfig,
                                                           StorageEngine<ByteArray,byte[],byte[]> storageEngine,
                                                           StoreRepository storeRepository,
                                                           NetworkClassLoader networkClassLoader)
Method Detail

processEntry

protected void processEntry(ByteArray key,
                            Versioned<byte[]> value)
                     throws java.io.IOException
Overrides:
processEntry in class UpdatePartitionEntriesStreamRequestHandler
Throws:
java.io.IOException

getHandlerName

protected java.lang.String getHandlerName()
Overrides:
getHandlerName in class UpdatePartitionEntriesStreamRequestHandler


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