Modifier and Type | Field and Description |
---|---|
Map<Scheduler.WorkerInfoIdentity,CloseableResource<BlockWorkerClient>> |
mActiveWorkers |
Constructor and Description |
---|
WorkerInfoHub(Scheduler scheduler,
WorkerProvider workerProvider)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
enqueueTaskForWorker(WorkerInfo workerInfo,
Task task)
Enqueue task for worker.
|
Map<Scheduler.WorkerInfoIdentity,Scheduler.BoundedPriorityBlockingQueue<Task>> |
getWorkerToTaskQ() |
void |
kickStartTasks()
Kick stark tasks for each worker task q.
|
void |
updateWorkers()
Refresh active workers.
|
public Map<Scheduler.WorkerInfoIdentity,CloseableResource<BlockWorkerClient>> mActiveWorkers
public WorkerInfoHub(Scheduler scheduler, WorkerProvider workerProvider)
scheduler
- schedulerworkerProvider
- worker providerpublic void kickStartTasks()
public boolean enqueueTaskForWorker(@Nullable WorkerInfo workerInfo, Task task)
workerInfo
- the workertask
- the taskpublic Map<Scheduler.WorkerInfoIdentity,Scheduler.BoundedPriorityBlockingQueue<Task>> getWorkerToTaskQ()
public void updateWorkers()
Copyright © 2023. All Rights Reserved.