Class VenicePath
java.lang.Object
com.linkedin.venice.router.api.path.VenicePath
- All Implemented Interfaces:
ResourcePath<RouterKey>
- Direct Known Subclasses:
VeniceMultiKeyPath,VeniceSingleGetPath
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final RouterRetryConfigprotected final RetryManagerprotected final StoreVersionName -
Constructor Summary
ConstructorsConstructorDescriptionVenicePath(StoreVersionName storeVersionName, RouterRetryConfig retryConfig, RetryManager retryManager, VeniceResponseDecompressor responseDecompressor) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanRequestStorageNode(String storageNode) This function is used to check whether Router could send retry request to the specified storage node.org.apache.http.client.methods.HttpUriRequestcomposeRouterRequest(String storageNodeUri) abstract org.apache.http.client.methods.HttpUriRequestcomposeRouterRequestInternal(String storageNodeUri) abstract byte[]getBody()intabstract io.netty.handler.codec.http.HttpMethodabstract intlonglongintabstract RequestTypeintprotected RequestTypeprotected TimegetTime()abstract StringintbooleanbooleanisLongTailRetryWithinBudget(int numberOfRoutes) booleanbooleanThis function will check whether the retry request already passed the retry delay threshold.booleanbooleanvoidmarkStorageNodeAsFast(String fastStorageNode) voidvoidvoidrequestStorageNode(String storageNode) voidsetChunkedWriteHandler(io.netty.channel.ChannelHandlerContext ctx, VeniceChunkedWriteHandler chunkedWriteHandler, RouterStats<AggRouterHttpRequestStats> routerStats) voidsetHelixGroupId(int helixGroupId) protected voidsetPartitionKeys(Collection<RouterKey> keys) voidvoidsetRetryRequest(io.netty.handler.codec.http.HttpResponseStatus hrs) If the inherited class wants to know whether the current path belongs to a retry request or not, it needs to implement this method properly to maintain the internal state.protected voidsetupRetryRelatedInfo(VenicePath originalPath) voidsetupVeniceHeaders(BiConsumer<String, String> setupHeaderFunc) abstract VenicePathabstract VenicePathMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.linkedin.alpini.router.api.ResourcePath
getLocation, getPartitionKey
-
Field Details
-
storeVersionName
-
retryConfig
-
retryManager
-
-
Constructor Details
-
VenicePath
public VenicePath(StoreVersionName storeVersionName, RouterRetryConfig retryConfig, RetryManager retryManager, VeniceResponseDecompressor responseDecompressor)
-
-
Method Details
-
getRequestId
public long getRequestId() -
getHelixGroupId
public int getHelixGroupId() -
setHelixGroupId
public void setHelixGroupId(int helixGroupId) -
isSmartLongTailRetryEnabled
public boolean isSmartLongTailRetryEnabled() -
getSmartLongTailRetryAbortThresholdMs
public int getSmartLongTailRetryAbortThresholdMs() -
setPartitionKeys
-
getPartitionKeys
- Specified by:
getPartitionKeysin interfaceResourcePath<RouterKey>
-
getRequestSize
public int getRequestSize() -
getVersionNumber
public int getVersionNumber() -
getResourceName
- Specified by:
getResourceNamein interfaceResourcePath<RouterKey>
-
getStoreName
-
setRetryRequest
public void setRetryRequest()- Specified by:
setRetryRequestin interfaceResourcePath<RouterKey>
-
setRetryRequest
public void setRetryRequest(io.netty.handler.codec.http.HttpResponseStatus hrs) Description copied from interface:ResourcePathIf the inherited class wants to know whether the current path belongs to a retry request or not, it needs to implement this method properly to maintain the internal state.- Specified by:
setRetryRequestin interfaceResourcePath<RouterKey>
-
setupRetryRelatedInfo
-
isRetryRequest
public boolean isRetryRequest() -
getOriginalRequestStartTs
public long getOriginalRequestStartTs() -
getLongTailRetryThresholdMs
public abstract int getLongTailRetryThresholdMs() -
requestStorageNode
-
markStorageNodeAsFast
-
canRequestStorageNode
This function is used to check whether Router could send retry request to the specified storage node. It will return false if the requested storage node has been marked as slow.- Parameters:
storageNode-- Returns:
-
recordOriginalRequestStartTimestamp
public void recordOriginalRequestStartTimestamp() -
isRetryRequestTooLate
public boolean isRetryRequestTooLate()This function will check whether the retry request already passed the retry delay threshold. If yes, return true.- Returns:
-
setupVeniceHeaders
-
composeRouterRequest
-
setChunkedWriteHandler
public void setChunkedWriteHandler(io.netty.channel.ChannelHandlerContext ctx, VeniceChunkedWriteHandler chunkedWriteHandler, RouterStats<AggRouterHttpRequestStats> routerStats) -
getClientComputeHeader
-
getResponseDecompressor
-
getChunkedResponse
-
isStreamingRequest
public boolean isStreamingRequest() -
isLongTailRetryAllowedForNewRequest
public boolean isLongTailRetryAllowedForNewRequest() -
getRequestType
-
getStreamingRequestType
-
substitutePartitionKey
-
substitutePartitionKey
-
composeRouterRequestInternal
public abstract org.apache.http.client.methods.HttpUriRequest composeRouterRequestInternal(String storageNodeUri) -
getHttpMethod
public abstract io.netty.handler.codec.http.HttpMethod getHttpMethod() -
getBody
public abstract byte[] getBody() -
getVeniceApiVersionHeader
-
recordRequest
public void recordRequest() -
isLongTailRetryWithinBudget
public boolean isLongTailRetryWithinBudget(int numberOfRoutes) -
getTime
-