|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.smila.taskmanager.internal.TaskManagerImpl
public class TaskManagerImpl
The TaskManager implementation.
| Field Summary |
|---|
| Fields inherited from interface org.eclipse.smila.taskmanager.TaskManager |
|---|
CONFIGURATION_BUNDLE, FINISHING_TASKS_WORKER, PREFIX_INTERNAL, TASKERROR_TIME_TO_LIVE |
| Constructor Summary | |
|---|---|
TaskManagerImpl()
|
|
| Method Summary | |
|---|---|
protected void |
activate(ComponentContext context)
OSGi Declarative Services service activation method. |
void |
addInProgressTask(Task task)
|
void |
addTask(Task task)
|
void |
addTaskQueue(java.lang.String workerName)
|
void |
addTasks(java.util.Collection<Task> taskList)
add tasks to the system (e.g. |
void |
finishTask(java.lang.String workerName,
java.lang.String taskId,
ResultDescription resultDescription)
Remove task from in-progress and put it into finishing queue. |
void |
finishTasks(java.lang.String workerName,
java.util.Collection<java.lang.String> qualifiers,
ResultDescription resultDescription)
Finish all qualified tasks matching the qualifier condition. |
long |
getFailSafetyLevel()
|
long |
getMaxScaleUp()
|
java.util.Map<java.lang.String,java.lang.Integer> |
getScaleUpCounters()
|
Task |
getTask(java.lang.String workerName,
java.lang.String host)
Get next task for worker with name workerName. |
Task |
getTask(java.lang.String workerName,
java.lang.String host,
java.util.Collection<java.lang.String> qualifiers)
Get next task for worker with name workerName that match the given qualifiers. |
java.util.Map<java.lang.String,TaskCounter> |
getTaskCounters()
Get number of tasks in all current queues. |
Any |
getTaskInfo(java.lang.String workerName,
java.lang.String section,
java.lang.String taskName)
Prepares information on a task stored in the task storage. |
TaskList |
getTaskList(java.lang.String workerName,
java.lang.String section,
int maxCount)
Get task list for current task pipe and sub-type. |
void |
keepAlive(java.lang.String workerName,
java.lang.String taskId)
Prevent rollback of task due to exceeded time-to-live. |
void |
removeTasks(AnyMap filterMap)
Remove canceled tasks identified by the filter map. |
void |
setClusterConfigService(ClusterConfigService ccs)
needed to get cluster configuration. |
void |
setTaskStorage(TaskStorage taskStorage)
|
void |
unsetClusterConfigService(ClusterConfigService ccs)
|
void |
unsetTaskStorage(TaskStorage taskStorage)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TaskManagerImpl()
| Method Detail |
|---|
protected void activate(ComponentContext context)
context - OSGi service component context.
public void addTask(Task task)
throws TaskmanagerException
addTask in interface TaskManagertask - the task to add to the todo queue of its worker (contained in task)
TaskmanagerException
public void addTasks(java.util.Collection<Task> taskList)
throws TaskmanagerException
addTasks in interface TaskManagertaskList - the list of tasks to add.
TaskmanagerException
public void addInProgressTask(Task task)
throws TaskmanagerException
addInProgressTask in interface TaskManagertask - the task to add to the in progress queue of its worker (contained in task)
TaskmanagerException
public Task getTask(java.lang.String workerName,
java.lang.String host)
throws TaskmanagerException
getTask in interface TaskManagerworkerName - the worker namehost - the host name where the worker is running that requested the task
TaskmanagerException - an error while looking up or returning the task for the given worker.TaskManager#getTask(String, Collection)
public Task getTask(java.lang.String workerName,
java.lang.String host,
java.util.Collection<java.lang.String> qualifiers)
throws TaskmanagerException
getTask in interface TaskManagerworkerName - the worker namehost - the host name where the worker is running that requested the taskqualifiers - qualifiers to describe the task.
TaskmanagerException - an error while looking up or returning the task for the given worker.
public void finishTask(java.lang.String workerName,
java.lang.String taskId,
ResultDescription resultDescription)
throws TaskmanagerException
finishTask in interface TaskManagerworkerName - the worker nametaskId - the id of the task to be finishedresultDescription - the result description for the task to be finished.
TaskmanagerException - an error occurred while trying to finish the task.
public void keepAlive(java.lang.String workerName,
java.lang.String taskId)
throws TaskmanagerException
keepAlive in interface TaskManagerworkerName - the worker name.taskId - the ID of the task.
TaskmanagerException - an error occurred while trying to send keep alive for this task.
public void finishTasks(java.lang.String workerName,
java.util.Collection<java.lang.String> qualifiers,
ResultDescription resultDescription)
throws TaskmanagerException
finishTasks in interface TaskManagerworkerName - the worker name.qualifiers - qualifiers describing the condition. Must not be null. If it is empty, nothing is done.resultDescription - the result description for the tasks to be finished.
TaskmanagerException - an exception occurred while trying to delete the tasks.
public void removeTasks(AnyMap filterMap)
throws TaskmanagerException
removeTasks in interface TaskManagerfilterMap - map to identify tasks to be removed
TaskmanagerException - an exception if something went wrong
public void addTaskQueue(java.lang.String workerName)
throws TaskmanagerException
addTaskQueue in interface TaskManagerworkerName - worker for which to add a task queue with given name.
TaskmanagerException
public java.util.Map<java.lang.String,TaskCounter> getTaskCounters()
throws TaskmanagerException
getTaskCounters in interface TaskManagerTaskmanagerException - counting fails
public TaskList getTaskList(java.lang.String workerName,
java.lang.String section,
int maxCount)
throws TaskmanagerException
getTaskList in interface TaskManagerworkerName - name/id as stringsection - task pipe sub-type: "inprogress" or "todo".maxCount - max. number of tasks in return list
TaskmanagerException - if accessing task list fails
public Any getTaskInfo(java.lang.String workerName,
java.lang.String section,
java.lang.String taskName)
throws TaskmanagerException
getTaskInfo in interface TaskManagerworkerName - pipe in which the task is storedsection - queue section ("todo" or "inprogress")taskName - task identifier
TaskmanagerException - on errorpublic long getFailSafetyLevel()
getFailSafetyLevel in interface TaskManagerpublic long getMaxScaleUp()
getMaxScaleUp in interface TaskManager
public java.util.Map<java.lang.String,java.lang.Integer> getScaleUpCounters()
throws TaskmanagerException
getScaleUpCounters in interface TaskManagerTaskmanagerException - on error.public void setTaskStorage(TaskStorage taskStorage)
taskStorage - the new task storagepublic void unsetTaskStorage(TaskStorage taskStorage)
taskStorage - the task storagepublic void setClusterConfigService(ClusterConfigService ccs)
public void unsetClusterConfigService(ClusterConfigService ccs)
ccs - the cluster config service to unset
|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||