Class WeightedRoundRobinMultiplexer

java.lang.Object
org.apache.hadoop.ipc.WeightedRoundRobinMultiplexer
All Implemented Interfaces:
RpcMultiplexer

public class WeightedRoundRobinMultiplexer extends Object implements RpcMultiplexer
Determines which queue to start reading from, occasionally drawing from low-priority queues in order to prevent starvation. Given the pull pattern [9, 4, 1] for 3 queues: The cycle is (a minimum of) 9+4+1=14 reads. Queue 0 is read (at least) 9 times Queue 1 is read (at least) 4 times Queue 2 is read (at least) 1 time Repeat There may be more reads than the minimum due to race conditions. This is allowed by design for performance reasons.
  • Field Details

    • IPC_CALLQUEUE_WRRMUX_WEIGHTS_KEY

      public static final String IPC_CALLQUEUE_WRRMUX_WEIGHTS_KEY
      See Also:
    • LOG

      public static final org.slf4j.Logger LOG
  • Constructor Details

    • WeightedRoundRobinMultiplexer

      public WeightedRoundRobinMultiplexer(int aNumQueues, String ns, Configuration conf)
  • Method Details

    • getAndAdvanceCurrentIndex

      public int getAndAdvanceCurrentIndex()
      Use the mux by getting and advancing index.
      Specified by:
      getAndAdvanceCurrentIndex in interface RpcMultiplexer
      Returns:
      current index