Class VeniceMultiKeyPath<K>

    • Field Detail

      • keyNum

        protected int keyNum
      • routerKeyMap

        protected final java.util.Map<RouterKey,​K> routerKeyMap
    • Constructor Detail

      • VeniceMultiKeyPath

        public VeniceMultiKeyPath​(java.lang.String storeName,
                                  int versionNumber,
                                  java.lang.String resourceName,
                                  boolean smartLongTailRetryEnabled,
                                  int smartLongTailRetryAbortThresholdMs,
                                  int longTailRetryMaxRouteForMultiKeyReq)
      • VeniceMultiKeyPath

        public VeniceMultiKeyPath​(java.lang.String storeName,
                                  int versionNumber,
                                  java.lang.String resourceName,
                                  boolean smartLongTailRetryEnabled,
                                  int smartLongTailRetryAbortThresholdMs,
                                  java.util.Map<RouterKey,​K> routerKeyMap,
                                  int longTailRetryMaxRouteForMultiKeyReq)
    • Method Detail

      • initialize

        public void initialize​(java.lang.String storeName,
                               java.lang.String resourceName,
                               java.lang.Iterable<java.nio.ByteBuffer> keys,
                               VenicePartitionFinder partitionFinder,
                               int maxKeyCount,
                               RouterStats<AggRouterHttpRequestStats> stats)
                        throws RouterException
        Fill the router key map and the index2routerKey map.
        Parameters:
        storeName -
        resourceName -
        keys - Multiple keys from client request; keys have been deserialized to ByteBuffer
        partitionFinder -
        maxKeyCount -
        Throws:
        RouterException
      • composeRouterRequestInternal

        public org.apache.http.client.methods.HttpUriRequest composeRouterRequestInternal​(java.lang.String storageNodeUri)
        Specified by:
        composeRouterRequestInternal in class VenicePath
      • getHttpMethod

        public io.netty.handler.codec.http.HttpMethod getHttpMethod()
        Specified by:
        getHttpMethod in class VenicePath
      • getLongTailRetryMaxRouteForMultiKeyReq

        public int getLongTailRetryMaxRouteForMultiKeyReq()
      • createRouterRequestKey

        protected abstract K createRouterRequestKey​(java.nio.ByteBuffer key,
                                                    int keyIdx,
                                                    int partitionId)
        Create a router request key.
        Parameters:
        key -
        keyIdx -
        partitionId -
        Returns:
        An instance of ComputeRouterRequestKeyV1 for compute request; return an instance of MultiGetRouterRequestKeyV1 for multi-get
      • fixRetryRequestForSubPath

        protected abstract VenicePath fixRetryRequestForSubPath​(java.util.Map<RouterKey,​K> routerKeyMap)
        Parameters:
        routerKeyMap -
        Returns:
        a sub-path with a new set of keys
      • serializeRouterRequest

        protected abstract 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 keys
        Returns: