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 RouterRetryConfig
protected final RetryManager
protected final StoreVersionName
-
Constructor Summary
ConstructorsConstructorDescriptionVenicePath
(StoreVersionName storeVersionName, RouterRetryConfig retryConfig, RetryManager retryManager, VeniceResponseDecompressor responseDecompressor) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canRequestStorageNode
(String storageNode) This function is used to check whether Router could send retry request to the specified storage node.org.apache.http.client.methods.HttpUriRequest
composeRouterRequest
(String storageNodeUri) abstract org.apache.http.client.methods.HttpUriRequest
composeRouterRequestInternal
(String storageNodeUri) abstract byte[]
getBody()
int
abstract io.netty.handler.codec.http.HttpMethod
abstract int
long
long
int
abstract RequestType
int
protected RequestType
protected Time
getTime()
abstract String
int
boolean
boolean
isLongTailRetryWithinBudget
(int numberOfRoutes) boolean
boolean
This function will check whether the retry request already passed the retry delay threshold.boolean
boolean
void
markStorageNodeAsFast
(String fastStorageNode) void
void
void
requestStorageNode
(String storageNode) void
setChunkedWriteHandler
(io.netty.channel.ChannelHandlerContext ctx, VeniceChunkedWriteHandler chunkedWriteHandler, RouterStats<AggRouterHttpRequestStats> routerStats) void
setHelixGroupId
(int helixGroupId) protected void
setPartitionKeys
(Collection<RouterKey> keys) void
void
setRetryRequest
(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 void
setupRetryRelatedInfo
(VenicePath originalPath) void
setupVeniceHeaders
(BiConsumer<String, String> setupHeaderFunc) abstract VenicePath
abstract VenicePath
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
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:
getPartitionKeys
in interfaceResourcePath<RouterKey>
-
getRequestSize
public int getRequestSize() -
getVersionNumber
public int getVersionNumber() -
getResourceName
- Specified by:
getResourceName
in interfaceResourcePath<RouterKey>
-
getStoreName
-
setRetryRequest
public void setRetryRequest()- Specified by:
setRetryRequest
in interfaceResourcePath<RouterKey>
-
setRetryRequest
public void setRetryRequest(io.netty.handler.codec.http.HttpResponseStatus hrs) Description copied from interface:ResourcePath
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.- Specified by:
setRetryRequest
in 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
-