public class ControlledWorkerScheduler<T> extends Object implements Scheduler<T>, TaskWrapperAware
ControlledWorkerUnion
,
ControlledWorkerJoin
,
ControlledWorkerBoundJoin
Modifier and Type | Class and Description |
---|---|
protected class |
ControlledWorkerScheduler.ControlStatus
Structure to maintain the status for a given control instance.
|
Constructor and Description |
---|
ControlledWorkerScheduler()
Deprecated.
use
ControlledWorkerScheduler(int, String) . Scheduled to be removed in 4.0 |
ControlledWorkerScheduler(int nWorkers,
String name)
Construct a new instance with the specified number of workers and the given name.
|
Modifier and Type | Method and Description |
---|---|
void |
abort()
Abort the execution of running and queued tasks.
|
void |
done()
Inform the scheduler that a certain task is done.
|
int |
getNumberOfTasks() |
int |
getTotalNumberOfWorkers() |
void |
handleResult(CloseableIteration<T,QueryEvaluationException> res)
Callback to handle the result.
|
void |
informFinish()
Inform the scheduler that no more tasks will be scheduled.
|
void |
informFinish(ParallelExecutor<T> control)
Inform this scheduler that the specified control instance will no longer submit tasks.
|
boolean |
isRunning()
Determine if the scheduler has unfinished tasks.
|
boolean |
isRunning(ParallelExecutor<T> control)
Determine if there are still task running or queued for the specified control.
|
void |
schedule(ParallelTask<T> task)
Schedule the specified parallel task.
|
void |
scheduleAll(List<ParallelTask<T>> tasks,
ParallelExecutor<T> control)
Schedule the given tasks and inform about finish using the same lock, i.e.
|
void |
setTaskWrapper(TaskWrapper taskWrapper)
Set the
TaskWrapper to the respective instance |
void |
shutdown() |
void |
toss(Exception e)
Toss an exception to the scheduler.
|
@Deprecated public ControlledWorkerScheduler()
ControlledWorkerScheduler(int, String)
. Scheduled to be removed in 4.0public ControlledWorkerScheduler(int nWorkers, String name)
nWorkers
- name
- public void schedule(ParallelTask<T> task)
public void scheduleAll(List<ParallelTask<T>> tasks, ParallelExecutor<T> control)
tasks
- control
- public int getTotalNumberOfWorkers()
public int getNumberOfTasks()
public void abort()
Scheduler
public void done()
Scheduler
public void handleResult(CloseableIteration<T,QueryEvaluationException> res)
Scheduler
handleResult
in interface Scheduler<T>
public void informFinish()
Scheduler
informFinish
in interface Scheduler<T>
public void informFinish(ParallelExecutor<T> control)
control
- public boolean isRunning()
Scheduler
public boolean isRunning(ParallelExecutor<T> control)
control
- public void toss(Exception e)
Scheduler
public void setTaskWrapper(TaskWrapper taskWrapper)
TaskWrapperAware
TaskWrapper
to the respective instancesetTaskWrapper
in interface TaskWrapperAware
Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.