voldemort.server.protocol.admin
Class FullScanFetchStreamRequestHandler
java.lang.Object
voldemort.server.protocol.admin.FetchStreamRequestHandler
voldemort.server.protocol.admin.FullScanFetchStreamRequestHandler
- All Implemented Interfaces:
- StreamRequestHandler
- Direct Known Subclasses:
- FullScanFetchEntriesRequestHandler, FullScanFetchKeysRequestHandler
public abstract class FullScanFetchStreamRequestHandler
- extends FetchStreamRequestHandler
Base class for key/entry stream fetching handlers that do an unordered full scan to fetch items.
Fields inherited from class voldemort.server.protocol.admin.FetchStreamRequestHandler |
errorCodeMapper, fetched, fetchOrphaned, filter, initialCluster, isJmxEnabled, logger, nodeId, operation, partitionIds, recordsPerPartition, request, scanned, startTimeMs, storageEngine, storeDef, storeInstance, streamStats, throttler |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
keyIterator
protected final ClosableIterator<ByteArray> keyIterator
partitionFetches
protected java.util.Map<java.lang.Integer,java.lang.Long> partitionFetches
partitionsToFetch
protected java.util.Set<java.lang.Integer> partitionsToFetch
FullScanFetchStreamRequestHandler
public FullScanFetchStreamRequestHandler(VAdminProto.FetchPartitionEntriesRequest request,
MetadataStore metadataStore,
ErrorCodeMapper errorCodeMapper,
VoldemortConfig voldemortConfig,
StoreRepository storeRepository,
NetworkClassLoader networkClassLoader,
StreamingStats.Operation operation)
isKeyNeeded
protected boolean isKeyNeeded(byte[] key)
- Determines if the key is needed. To be 'needed', a key must (i) belong to a partition being
requested and (ii) be necessary to meet recordsPerPartition constraint, if any.
- Parameters:
key
-
- Returns:
- true iff key is needed.
isItemAccepted
protected boolean isItemAccepted(byte[] key)
- Determines if entry is accepted. For normal usage, this means confirming that the key is
needed. For orphan usage, this simply means confirming the key belongs to the node.
- Parameters:
key
-
- Returns:
- true iff entry is accepted.
accountForFetchedKey
protected void accountForFetchedKey(byte[] key)
- Account for key being fetched.
- Parameters:
key
-
fetchedEnoughForAllPartitions
protected boolean fetchedEnoughForAllPartitions()
- True iff enough items have been fetched for all partitions, where 'enough' is relative to
recordsPerPartition value.
- Returns:
- true iff enough items have been fetched for all partitions
determineRequestHandlerState
protected StreamRequestHandler.StreamRequestHandlerState determineRequestHandlerState(java.lang.String itemTag)
- Determines if still WRITING or COMPLETE.
- Parameters:
itemTag
- mad libs style string to insert into progress message.
- Returns:
- state of stream request handler
close
public final void close(java.io.DataOutputStream outputStream)
throws java.io.IOException
- Specified by:
close
in interface StreamRequestHandler
- Overrides:
close
in class FetchStreamRequestHandler
- Throws:
java.io.IOException
Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu