Package org.apache.hadoop.ipc
Class WeightedRoundRobinMultiplexer
java.lang.Object
org.apache.hadoop.ipc.WeightedRoundRobinMultiplexer
- All Implemented Interfaces:
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 -
Constructor Summary
ConstructorsConstructorDescriptionWeightedRoundRobinMultiplexer(int aNumQueues, String ns, Configuration conf) -
Method Summary
Modifier and TypeMethodDescriptionintUse the mux by getting and advancing index.
-
Field Details
-
IPC_CALLQUEUE_WRRMUX_WEIGHTS_KEY
- See Also:
-
LOG
public static final org.slf4j.Logger LOG
-
-
Constructor Details
-
WeightedRoundRobinMultiplexer
-
-
Method Details
-
getAndAdvanceCurrentIndex
public int getAndAdvanceCurrentIndex()Use the mux by getting and advancing index.- Specified by:
getAndAdvanceCurrentIndexin interfaceRpcMultiplexer- Returns:
- current index
-