Class VenicePath

    • Field Detail

      • storeName

        protected final java.lang.String storeName
      • versionNumber

        protected final int versionNumber
    • Constructor Detail

      • VenicePath

        public VenicePath​(java.lang.String storeName,
                          int versionNumber,
                          java.lang.String resourceName,
                          boolean smartLongTailRetryEnabled,
                          int smartLongTailRetryAbortThresholdMs,
                          RetryManager retryManager)
      • VenicePath

        public VenicePath​(java.lang.String storeName,
                          int versionNumber,
                          java.lang.String resourceName,
                          boolean smartLongTailRetryEnabled,
                          int smartLongTailRetryAbortThresholdMs,
                          Time time,
                          RetryManager retryManager)
    • Method Detail

      • 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​(java.util.Collection<RouterKey> keys)
      • getRequestSize

        public int getRequestSize()
      • getVersionNumber

        public int getVersionNumber()
      • getStoreName

        public java.lang.String getStoreName()
      • 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 int getLongTailRetryThresholdMs()
      • setLongTailRetryThresholdMs

        public void setLongTailRetryThresholdMs​(int longTailRetryThresholdMs)
      • requestStorageNode

        public void requestStorageNode​(java.lang.String storageNode)
      • markStorageNodeAsFast

        public void markStorageNodeAsFast​(java.lang.String fastStorageNode)
      • canRequestStorageNode

        public boolean canRequestStorageNode​(java.lang.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​(java.util.function.BiConsumer<java.lang.String,​java.lang.String> setupHeaderFunc)
      • composeRouterRequest

        public org.apache.http.client.methods.HttpUriRequest composeRouterRequest​(java.lang.String storageNodeUri)
      • setResponseHeaders

        public void setResponseHeaders​(java.util.Map<java.lang.CharSequence,​java.lang.String> responseHeaders)
      • getResponseHeaders

        public java.util.Optional<java.util.Map<java.lang.CharSequence,​java.lang.String>> getResponseHeaders()
      • isStreamingRequest

        public boolean isStreamingRequest()
      • isLongTailRetryAllowedForNewRequest

        public boolean isLongTailRetryAllowedForNewRequest()
      • getRequestType

        public abstract RequestType getRequestType()
      • getStreamingRequestType

        protected RequestType getStreamingRequestType()
      • substitutePartitionKey

        public abstract VenicePath substitutePartitionKey​(@Nonnull
                                                          java.util.Collection<RouterKey> s)
      • composeRouterRequestInternal

        public abstract org.apache.http.client.methods.HttpUriRequest composeRouterRequestInternal​(java.lang.String storageNodeUri)
      • getHttpMethod

        public abstract io.netty.handler.codec.http.HttpMethod getHttpMethod()
      • getBody

        public abstract byte[] getBody()
      • getVeniceApiVersionHeader

        public abstract java.lang.String getVeniceApiVersionHeader()
      • recordRequest

        public void recordRequest()
      • isLongTailRetryWithinBudget

        public boolean isLongTailRetryWithinBudget​(int numberOfRoutes)