public class ConsistentHashPolicy extends Object implements WorkerLocationPolicy
WorkerLocationPolicy.Factory
Constructor and Description |
---|
ConsistentHashPolicy(AlluxioConfiguration conf)
Constructs a new
ConsistentHashPolicy . |
Modifier and Type | Method and Description |
---|---|
List<BlockWorkerInfo> |
getPreferredWorkers(List<BlockWorkerInfo> blockWorkerInfos,
String fileId,
int count)
Find a specified number of workers following the logic defined by the policy.
|
public ConsistentHashPolicy(AlluxioConfiguration conf)
ConsistentHashPolicy
.conf
- the configuration used by the policypublic List<BlockWorkerInfo> getPreferredWorkers(List<BlockWorkerInfo> blockWorkerInfos, String fileId, int count) throws ResourceExhaustedException
WorkerLocationPolicy
ResourceExhaustedException
.
We want the semantics here to be explicit when the requirement cannot be satisfied.
So the caller should define its own logic handling the exception and finding backups.getPreferredWorkers
in interface WorkerLocationPolicy
ResourceExhaustedException
- if unable to return exactly #{count} workersCopyright © 2023. All Rights Reserved.