Class VenicePath

java.lang.Object
com.linkedin.venice.router.api.path.VenicePath
All Implemented Interfaces:
ResourcePath<RouterKey>
Direct Known Subclasses:
VeniceMultiKeyPath, VeniceSingleGetPath

public abstract class VenicePath extends Object implements ResourcePath<RouterKey>
  • Field Details

  • Constructor Details

  • 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

      protected void setPartitionKeys(Collection<RouterKey> keys)
    • getPartitionKeys

      @Nonnull public Collection<RouterKey> getPartitionKeys()
      Specified by:
      getPartitionKeys in interface ResourcePath<RouterKey>
    • getRequestSize

      public int getRequestSize()
    • getVersionNumber

      public int getVersionNumber()
    • getResourceName

      @Nonnull public String getResourceName()
      Specified by:
      getResourceName in interface ResourcePath<RouterKey>
    • getStoreName

      public String getStoreName()
    • setRetryRequest

      public void setRetryRequest()
      Specified by:
      setRetryRequest in interface ResourcePath<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 interface ResourcePath<RouterKey>
    • setupRetryRelatedInfo

      protected void setupRetryRelatedInfo(VenicePath originalPath)
    • isRetryRequest

      public boolean isRetryRequest()
    • getOriginalRequestStartTs

      public long getOriginalRequestStartTs()
    • getLongTailRetryThresholdMs

      public abstract int getLongTailRetryThresholdMs()
    • requestStorageNode

      public void requestStorageNode(String storageNode)
    • markStorageNodeAsFast

      public void markStorageNodeAsFast(String fastStorageNode)
    • canRequestStorageNode

      public boolean canRequestStorageNode(String storageNode)
      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

      public void setupVeniceHeaders(BiConsumer<String,String> setupHeaderFunc)
    • composeRouterRequest

      public org.apache.http.client.methods.HttpUriRequest composeRouterRequest(String storageNodeUri)
    • setChunkedWriteHandler

      public void setChunkedWriteHandler(io.netty.channel.ChannelHandlerContext ctx, VeniceChunkedWriteHandler chunkedWriteHandler, RouterStats<AggRouterHttpRequestStats> routerStats)
    • getClientComputeHeader

      @Nullable public String getClientComputeHeader()
    • getResponseDecompressor

      public VeniceResponseDecompressor getResponseDecompressor()
    • getChunkedResponse

      @Nullable public VeniceChunkedResponse getChunkedResponse()
    • isStreamingRequest

      public boolean isStreamingRequest()
    • isLongTailRetryAllowedForNewRequest

      public boolean isLongTailRetryAllowedForNewRequest()
    • getRequestType

      public abstract RequestType getRequestType()
    • getStreamingRequestType

      protected RequestType getStreamingRequestType()
    • substitutePartitionKey

      public abstract VenicePath substitutePartitionKey(RouterKey s)
    • substitutePartitionKey

      public abstract VenicePath substitutePartitionKey(@Nonnull Collection<RouterKey> s)
    • 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

      public abstract String getVeniceApiVersionHeader()
    • recordRequest

      public void recordRequest()
    • isLongTailRetryWithinBudget

      public boolean isLongTailRetryWithinBudget(int numberOfRoutes)
    • getTime

      protected Time getTime()