Class VeniceComputePath
- java.lang.Object
-
- com.linkedin.venice.router.api.path.VenicePath
-
- com.linkedin.venice.router.api.path.VeniceMultiKeyPath<ComputeRouterRequestKeyV1>
-
- com.linkedin.venice.router.api.path.VeniceComputePath
-
- All Implemented Interfaces:
ResourcePath<RouterKey>
public class VeniceComputePath extends VeniceMultiKeyPath<ComputeRouterRequestKeyV1>
-
-
Field Summary
-
Fields inherited from class com.linkedin.venice.router.api.path.VeniceMultiKeyPath
keyNum, routerKeyMap
-
Fields inherited from class com.linkedin.venice.router.api.path.VenicePath
retryManager, storeName, versionNumber
-
-
Constructor Summary
Constructors Constructor Description VeniceComputePath(java.lang.String storeName, int versionNumber, java.lang.String resourceName, BasicFullHttpRequest request, VenicePartitionFinder partitionFinder, int maxKeyCount, boolean smartLongTailRetryEnabled, int smartLongTailRetryAbortThresholdMs, int longTailRetryMaxRouteForMultiKeyReq, RetryManager retryManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ComputeRouterRequestKeyV1
createRouterRequestKey(java.nio.ByteBuffer key, int keyIdx, int partitionId)
Create a router request key.protected VeniceComputePath
fixRetryRequestForSubPath(java.util.Map<RouterKey,ComputeRouterRequestKeyV1> routerKeyMap)
If the parent request is a retry request, the sub-request generated by scattering-gathering logic should be retry request as well.protected int
getComputeRequestLengthInBytes()
java.lang.String
getLocation()
RequestType
getRequestType()
RequestType
getStreamingRequestType()
java.lang.String
getVeniceApiVersionHeader()
protected byte[]
serializeRouterRequest()
For multi-get requests, simply serialize the set of RouterKey to bytes; for read compute requests, concatenate the compute request and the serialized keysvoid
setupVeniceHeaders(java.util.function.BiConsumer<java.lang.String,java.lang.String> setupHeaderFunc)
VeniceMultiGetPath
toMultiGetPath()
-
Methods inherited from class com.linkedin.venice.router.api.path.VeniceMultiKeyPath
composeRouterRequestInternal, getBody, getHttpMethod, getLongTailRetryMaxRouteForMultiKeyReq, initialize, isLongTailRetryAllowedForNewRequest, setupRetryRelatedInfo, substitutePartitionKey, substitutePartitionKey
-
Methods inherited from class com.linkedin.venice.router.api.path.VenicePath
canRequestStorageNode, composeRouterRequest, getChunkedResponse, getHelixGroupId, getLongTailRetryThresholdMs, getOriginalRequestStartTs, getPartitionKeys, getRequestId, getRequestSize, getResourceName, getResponseDecompressor, getResponseHeaders, getSmartLongTailRetryAbortThresholdMs, getStoreName, getVersionNumber, isLongTailRetryWithinBudget, isRetryRequest, isRetryRequestTooLate, isSmartLongTailRetryEnabled, isStreamingRequest, markStorageNodeAsFast, recordOriginalRequestStartTimestamp, recordRequest, requestStorageNode, setChunkedWriteHandler, setHelixGroupId, setLongTailRetryThresholdMs, setPartitionKeys, setResponseDecompressor, setResponseHeaders, setRetryRequest, setRetryRequest
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.linkedin.alpini.router.api.ResourcePath
getPartitionKey, hasMultiplePartitionKeys
-
-
-
-
Constructor Detail
-
VeniceComputePath
public VeniceComputePath(java.lang.String storeName, int versionNumber, java.lang.String resourceName, BasicFullHttpRequest request, VenicePartitionFinder partitionFinder, int maxKeyCount, boolean smartLongTailRetryEnabled, int smartLongTailRetryAbortThresholdMs, int longTailRetryMaxRouteForMultiKeyReq, RetryManager retryManager) throws RouterException
- Throws:
RouterException
-
-
Method Detail
-
getLocation
@Nonnull public java.lang.String getLocation()
-
getRequestType
public final RequestType getRequestType()
- Specified by:
getRequestType
in classVenicePath
-
getStreamingRequestType
public final RequestType getStreamingRequestType()
- Overrides:
getStreamingRequestType
in classVenicePath
-
toMultiGetPath
public VeniceMultiGetPath toMultiGetPath()
-
fixRetryRequestForSubPath
protected VeniceComputePath fixRetryRequestForSubPath(java.util.Map<RouterKey,ComputeRouterRequestKeyV1> routerKeyMap)
If the parent request is a retry request, the sub-request generated by scattering-gathering logic should be retry request as well.- Specified by:
fixRetryRequestForSubPath
in classVeniceMultiKeyPath<ComputeRouterRequestKeyV1>
- Parameters:
routerKeyMap
-- Returns:
-
createRouterRequestKey
protected ComputeRouterRequestKeyV1 createRouterRequestKey(java.nio.ByteBuffer key, int keyIdx, int partitionId)
Description copied from class:VeniceMultiKeyPath
Create a router request key.- Specified by:
createRouterRequestKey
in classVeniceMultiKeyPath<ComputeRouterRequestKeyV1>
- Returns:
- An instance of ComputeRouterRequestKeyV1 for compute request; return an instance of MultiGetRouterRequestKeyV1 for multi-get
-
serializeRouterRequest
protected byte[] serializeRouterRequest()
Description copied from class:VeniceMultiKeyPath
For multi-get requests, simply serialize the set of RouterKey to bytes; for read compute requests, concatenate the compute request and the serialized keys- Specified by:
serializeRouterRequest
in classVeniceMultiKeyPath<ComputeRouterRequestKeyV1>
- Returns:
-
setupVeniceHeaders
public void setupVeniceHeaders(java.util.function.BiConsumer<java.lang.String,java.lang.String> setupHeaderFunc)
- Overrides:
setupVeniceHeaders
in classVenicePath
-
getVeniceApiVersionHeader
public java.lang.String getVeniceApiVersionHeader()
- Specified by:
getVeniceApiVersionHeader
in classVenicePath
-
getComputeRequestLengthInBytes
protected int getComputeRequestLengthInBytes()
-
-