Package com.linkedin.venice.fastclient
Class MultiKeyRequestContext<K,V>
java.lang.Object
com.linkedin.venice.fastclient.RequestContext
com.linkedin.venice.fastclient.MultiKeyRequestContext<K,V>
- Type Parameters:
K- Key typeV- Value type
- Direct Known Subclasses:
BatchGetRequestContext,ComputeRequestContext
Keep track of the progress of a multi-key requests - batch get and compute. This includes tracking all the scatter
requests and utilities to gather responses.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classrepresents a key requested on a route and tracks info related to it but specific to the route -
Constructor Summary
ConstructorsConstructorDescriptionMultiKeyRequestContext(int numKeysInRequest, boolean isPartialSuccessAllowed) -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidcopyStateToRetryRequestContext(MultiKeyRequestContext<K, V> retryContext) intintLogical number of keys in this request, including keys served from cache.getKeys()intNumber of keys sent to servers in this attempt, used for group selection and latency attribution.booleanWhether any part of this request failed even though it may have completed normally (partial-success requests).booleanWhether a retry was sent for this request, in which case part of it may have been served by another group.voidsetFanoutSize(int fanoutSize) voidvoidsetRoutesForPartitionMapping(Map<Integer, Set<String>> routesForPartition) Methods inherited from class com.linkedin.venice.fastclient.RequestContext
addNonAvailableReplicaPartition, getCurrentVersion, getHelixGroupId, getInstanceHealthMonitor, getNonAvailableReplicaPartitions, getRequestId, getRequestType, getResultFuture, getRouteRequestMap, getServerClusterName, hasNonAvailablePartition, isRetryRequest, setCurrentVersion, setHelixGroupId, setInstanceHealthMonitor, setRequestId, setRequestSerializationTime, setResultFuture, setRetryRequest, setServerClusterName
-
Constructor Details
-
MultiKeyRequestContext
public MultiKeyRequestContext(int numKeysInRequest, boolean isPartialSuccessAllowed)
-
-
Method Details
-
setKeys
-
getKeyCount
public int getKeyCount()Description copied from class:RequestContextLogical number of keys in this request, including keys served from cache.- Overrides:
getKeyCountin classRequestContext
-
getRoutingKeyCount
public int getRoutingKeyCount()Description copied from class:RequestContextNumber of keys sent to servers in this attempt, used for group selection and latency attribution. Multi-key contexts require the dispatcher to prepare their post-cache key set before routing.- Overrides:
getRoutingKeyCountin classRequestContext
-
hasPartialResponseFailure
public boolean hasPartialResponseFailure()Description copied from class:RequestContextWhether any part of this request failed even though it may have completed normally (partial-success requests).- Overrides:
hasPartialResponseFailurein classRequestContext
-
isRetryTriggered
public boolean isRetryTriggered()Description copied from class:RequestContextWhether a retry was sent for this request, in which case part of it may have been served by another group.- Overrides:
isRetryTriggeredin classRequestContext
-
getKeys
-
addKey
-
getRoutes
-
copyStateToRetryRequestContext
-
getRoutesForPartitionMapping
-
setRoutesForPartitionMapping
-
setFanoutSize
public void setFanoutSize(int fanoutSize) -
getFanoutSize
public int getFanoutSize()
-