|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface TaskStorage
Implementors of this interface implement the storage of tasks in so-called workerNames which can be seen as virtual
queues. There may be but needn't to be a physical queue representation for a concrete worker.
Received tasks are not removed from the workerName directly, but marked as "in process". Tasks "in process" will not
be redelivered, as long as they aren't set unprocessed.
A client should surround consecutive calls with #startSession() and #endOfSession(String) calls to
get better performance.
| Method Summary | |
|---|---|
void |
clear()
remove all tasks from storage and reset all counters. |
void |
createTaskQueue(java.lang.String name)
|
void |
deleteTask(java.lang.String workerName,
java.lang.String taskId)
Remove the task from the inprogress part of the workers queue. |
long |
getFailSafetyLevel()
|
Task |
getInProgressTask(java.lang.String workerName,
java.lang.String taskId)
read the task content of an in-progress task. |
long |
getMaxNoOfTasksPerHost()
|
java.util.Map<java.lang.String,java.lang.Integer> |
getScaleUpCounters()
|
Task |
getTask(java.lang.String workerName,
java.lang.String workerHost,
java.util.Collection<java.lang.String> qualifiers)
Returns a task that's not "in process" from the given workerName for the given messageCondition. |
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. |
boolean |
hasTaskQueue(java.lang.String name)
|
boolean |
isLockedQualifier(java.lang.String workerName,
java.lang.String qualifier)
check if a lock exists for given worker and qualifier. |
void |
keepAlive(java.lang.String workerName,
java.lang.String taskId)
Signals that the worker processing the given task is still alive. |
void |
lockQualifiers(java.lang.String workerName,
java.util.Collection<java.lang.String> qualifiers)
prevent new todo tasks from being added for the given worker and qualifiers. |
void |
purge(java.lang.String workerName)
Remove all tasks from the given task pipe. |
void |
removeTasks(AnyMap filterMap)
Remove canceled tasks identified by the filter map from todo and in-progress queue. |
void |
setMaxNoOfTasksPerHost(long maxTasks)
|
void |
storeInProgressTask(Task task)
Stores a new task to the inprogress queue of the given task's worker. |
void |
storeTask(java.lang.String workerName,
Task task)
Stores a new task to the todo queue of the given workerName. |
void |
storeTask(Task task)
Stores a new task to the todo queue of the given task's worker. |
| Method Detail |
|---|
void storeTask(Task task)
throws TaskmanagerException
task - the task to store, contains the worker name
TaskmanagerException - if send fails
void storeTask(java.lang.String workerName,
Task task)
throws TaskmanagerException
task - the task to store.workerName - the worker for which to store the task.
TaskmanagerException - if send fails
void storeInProgressTask(Task task)
throws TaskmanagerException
task - the task to store, contains the worker name
TaskmanagerException - if send fails
Task getTask(java.lang.String workerName,
java.lang.String workerHost,
java.util.Collection<java.lang.String> qualifiers)
throws TaskmanagerException
workerName - the workerName where to get the task from.workerHost - the host name where the worker is running that requested the taskqualifiers - if not null, allowed qualifiers of returned task.
null if there is none
available.
TaskmanagerException - if receive fails
Task getInProgressTask(java.lang.String workerName,
java.lang.String taskId)
throws TaskmanagerException
workerName - name of workertaskId - task Id
TaskmanagerException - if task is not in-progress or other errors.
void deleteTask(java.lang.String workerName,
java.lang.String taskId)
throws TaskmanagerException
workerName - the workerName from where the task was originally get.taskId - the task identifier.
TaskmanagerException - if taskId is invalid or not marked as finishing
void keepAlive(java.lang.String workerName,
java.lang.String taskId)
throws TaskmanagerException
workerName - name/id as stringtaskId - task id that is currently processed as string
TaskmanagerException - if any error occurs
void purge(java.lang.String workerName)
throws TaskmanagerException
workerName - name/id as string
TaskmanagerException - if any error occurs
void lockQualifiers(java.lang.String workerName,
java.util.Collection<java.lang.String> qualifiers)
workerName - a worker's namequalifiers - a list of qualifiers to lock
boolean isLockedQualifier(java.lang.String workerName,
java.lang.String qualifier)
throws TaskmanagerException
TaskmanagerException
java.util.Map<java.lang.String,TaskCounter> getTaskCounters()
throws TaskmanagerException
TaskmanagerException - counting fails
TaskList getTaskList(java.lang.String workerName,
java.lang.String section,
int maxCount)
throws TaskmanagerException
workerName - 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
Any getTaskInfo(java.lang.String workerName,
java.lang.String section,
java.lang.String taskName)
throws TaskmanagerException
workerName - pipe in which the task is storedsection - queue section ("todo" or "inprogress")taskName - task identifier
TaskmanagerException - on errorlong getFailSafetyLevel()
void clear()
throws TaskmanagerException
TaskmanagerException - errorvoid setMaxNoOfTasksPerHost(long maxTasks)
maxTasks - maximum number of tasks that should be delivered to a host. (scale up control)long getMaxNoOfTasksPerHost()
java.util.Map<java.lang.String,java.lang.Integer> getScaleUpCounters()
throws TaskmanagerException
TaskmanagerException - on error.
void removeTasks(AnyMap filterMap)
throws TaskmanagerException
filterMap - map to identify tasks to be removed
TaskmanagerException - an exception if something went wrong
void createTaskQueue(java.lang.String name)
throws TaskmanagerException
name - the name of the task queue to create.
TaskmanagerException
boolean hasTaskQueue(java.lang.String name)
throws TaskmanagerException
name - the task queue name to check
TaskmanagerException
|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||