WeightedRoundRobinMultiplexer (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.ipc, class: WeightedRoundRobinMultiplexer

Package org.apache.hadoop.ipc

# 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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `IPC_CALLQUEUE_WRRMUX_WEIGHTS_KEY`
  `static final org.slf4j.Logger`
  `LOG`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `WeightedRoundRobinMultiplexer(int aNumQueues, String ns, Configuration conf)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getAndAdvanceCurrentIndex()`
  Use the mux by getting and advancing index.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### IPC_CALLQUEUE_WRRMUX_WEIGHTS_KEY

    public static final String IPC_CALLQUEUE_WRRMUX_WEIGHTS_KEY
    See Also:
      - Constant Field Values

  - ### 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