|
Lightweight Bartering Grid | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlbg.peer.workflow.BoT
public class BoT
Bag of Tasks.
Each Task is always in one of three states: unscheduled, scheduled and completed.
Tasks of Bag of Tasks are therefore separated into 3 sets, each of which is backed by a heap.
Scheduled and completed Tasks are stored according to their nominal id. Unscheduled Tasks are stored by their scheduling id, rather than by their nominal id, so as to preserve Temporal Task Grouping, i.e. scheduling decisions taken prior to the construction of the BoT.
Constructor Summary | |
---|---|
BoT(int job_id,
int bot_id,
Task[] tasks,
MetaGridData[] datas,
boolean is_supplying_task)
|
Method Summary | |
---|---|
java.util.Iterator<Task> |
completedTasks()
|
int |
countCompletedTasks()
|
int |
countScheduledTasks()
|
int |
countUncompletedTasks()
|
int |
countUnscheduledTasks()
|
RequestContainer |
flagTaskAsCompleted(Task returning_t)
|
RequestContainer |
flagTaskAsUnscheduled(Task returning_t,
boolean resync)
|
MetaGridData[] |
getUniqueMetaGridDatas()
Set of all data required by the BoT. |
boolean |
hasCompletedTasks()
|
boolean |
hasScheduledTasks()
|
boolean |
hasUnscheduledTasks()
|
int |
id()
|
boolean |
isCompleted()
|
int |
jobID()
|
Task |
peekFirstSupplyingTask()
Peeks at the Supplying Task that would selected for scheduling. |
java.util.Iterator<Task> |
scheduledTasks()
|
RequestContainer |
selectFirstConsumptionTask()
|
RequestContainer |
selectFirstLocalTask()
|
RequestContainer |
selectFirstSupplyingTask()
|
RequestContainer |
selectNextConsumptionTask(LocalQueueCursor lqc)
Selects next Consumption Task to schedule. |
int |
tasksCount()
|
java.lang.String |
toString()
|
java.util.Iterator<Task> |
unscheduledTasks()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BoT(int job_id, int bot_id, Task[] tasks, MetaGridData[] datas, boolean is_supplying_task) throws GridException
GridException
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public int jobID()
public int id()
public int tasksCount()
public java.util.Iterator<Task> unscheduledTasks()
public boolean hasUnscheduledTasks()
public int countUnscheduledTasks()
public java.util.Iterator<Task> scheduledTasks()
public boolean hasScheduledTasks()
public int countScheduledTasks()
public java.util.Iterator<Task> completedTasks()
public boolean hasCompletedTasks()
public int countCompletedTasks()
public int countUncompletedTasks()
public boolean isCompleted()
public MetaGridData[] getUniqueMetaGridDatas()
public RequestContainer selectFirstLocalTask() throws GridException
GridException
public RequestContainer selectFirstConsumptionTask() throws GridException
GridException
public RequestContainer selectNextConsumptionTask(LocalQueueCursor lqc) throws GridException
GridException
- if a parameter is illegalpublic Task peekFirstSupplyingTask() throws GridException
Recommendation: use this method only for waiting Supplying Tasks, as the Task is selected without update of the BoT state.
GridException
public RequestContainer selectFirstSupplyingTask() throws GridException
GridException
public RequestContainer flagTaskAsUnscheduled(Task returning_t, boolean resync) throws GridException
returning_t
- returning Task, i.e. copy of the original Task
(that comes back from another Grid node)resync
- if true, resynchronizes the metadata of the original Task
with the returning Task
GridException
public RequestContainer flagTaskAsCompleted(Task returning_t) throws GridException
GridException
|
Lightweight Bartering Grid | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2005-2008, Cyril Briquet, parts Xavier Dalem.