@NotThreadSafe public final class RoundRobinPolicy extends Object implements FileWriteLocationPolicy, BlockLocationPolicy
BlockLocationPolicy.Factory
Constructor and Description |
---|
RoundRobinPolicy()
Constructs a new
RoundRobinPolicy . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
WorkerNetAddress |
getWorker(GetWorkerOptions options)
Gets the worker's network address for serving operations requested for the block.
|
WorkerNetAddress |
getWorkerForNextBlock(Iterable<BlockWorkerInfo> workerInfoList,
long blockSizeBytes)
The policy uses the first fetch of worker info list as the base, and visits each of them in a
round-robin manner in the subsequent calls.
|
int |
hashCode() |
String |
toString() |
public RoundRobinPolicy()
RoundRobinPolicy
.@Nullable public WorkerNetAddress getWorkerForNextBlock(Iterable<BlockWorkerInfo> workerInfoList, long blockSizeBytes)
getWorkerForNextBlock
in interface FileWriteLocationPolicy
workerInfoList
- the info of the active workersblockSizeBytes
- the size of the block in bytes@Nullable public WorkerNetAddress getWorker(GetWorkerOptions options)
BlockLocationPolicy
getWorker
in interface BlockLocationPolicy
options
- the options to get a block worker network address for a blockCopyright © 2023. All Rights Reserved.