public interface WorkerLocationPolicy
Modifier and Type | Interface and Description |
---|---|
static class |
WorkerLocationPolicy.Factory
The factory for the
WorkerLocationPolicy . |
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.
|
List<BlockWorkerInfo> getPreferredWorkers(List<BlockWorkerInfo> blockWorkerInfos, String fileId, int count) throws ResourceExhaustedException
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.blockWorkerInfos
- fileId
- count
- ResourceExhaustedException
- if unable to return exactly #{count} workersCopyright © 2023. All Rights Reserved.