@ThreadSafe public final class LocalFirstPolicy extends Object implements FileWriteLocationPolicy, BlockLocationPolicy
BlockLocationPolicy.Factory
Constructor and Description |
---|
LocalFirstPolicy()
Constructs a
LocalFirstPolicy . |
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)
Gets the worker's host name for the next block to write to.
|
int |
hashCode() |
String |
toString() |
public LocalFirstPolicy()
LocalFirstPolicy
.@Nullable public WorkerNetAddress getWorkerForNextBlock(Iterable<BlockWorkerInfo> workerInfoList, long blockSizeBytes)
FileWriteLocationPolicy
getWorkerForNextBlock
in interface FileWriteLocationPolicy
workerInfoList
- the info of the active workersblockSizeBytes
- the size of the block in bytespublic 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.