OpenSDN source code
|
A class maintaning information for every <task, instance> More...
Public Member Functions | |
TaskEntry (int task_id) | |
TaskEntry (int task_id, int task_instance) | |
~TaskEntry () | |
void | AddPolicy (TaskEntry *entry) |
size_t | WaitQSize () const |
void | AddToWaitQ (Task *t) |
bool | DeleteFromWaitQ (Task *t) |
void | AddToDeferQ (TaskEntry *entry) |
Adds a task to deferq_. Only one task of a given instance goes into deferq_ for its policies. More... | |
void | DeleteFromDeferQ (TaskEntry &entry) |
Deletes a task from deferq_. More... | |
TaskEntry * | ActiveEntryInPolicy () |
bool | DeferOnPolicyFail (Task *t) |
void | RunTask (Task *t) |
Starts a task. If there are more entries in waitq_ add them to deferq_. More... | |
void | RunDeferQ () |
Starts executing tasks from deferq_ of a TaskEntry. More... | |
void | RunCombinedDeferQ () |
Starts executing tasks from deferq_ of TaskEntry and TaskGroup in the temporal order. More... | |
void | RunWaitQ () |
void | RunDeferEntry () |
void | RunDeferQForGroupEnable () |
Starts executing tasks from deferq_ of TaskEntries which are enabled. More... | |
void | TaskExited (Task *t, TaskGroup *group) |
TaskStats * | GetTaskStats () |
void | ClearTaskStats () |
void | ClearQueues () |
boost::optional< uint64_t > | GetTaskDeferEntrySeqno () const |
Addition/deletion of TaskEntry in the deferq_ is based on the seqno. seqno of the first Task in the waitq_ is used as the key. This function would be invoked by the comparison function during addition/deletion of TaskEntry in the deferq_. More... | |
int | GetTaskId () const |
int | GetTaskInstance () const |
int | GetRunCount () const |
void | SetDisable (bool disable) |
bool | IsDisabled () |
void | GetSandeshData (SandeshTaskEntry *resp) const |
Private Types | |
typedef boost::intrusive::member_hook < Task, boost::intrusive::list_member_hook <>,&Task::waitq_hook_ > | WaitQHook |
List of Task's in waitq_. More... | |
typedef boost::intrusive::list < Task, WaitQHook > | TaskWaitQ |
typedef boost::intrusive::member_hook < TaskEntry, boost::intrusive::set_member_hook <>,&TaskEntry::task_defer_node > | TaskDeferListOption |
typedef boost::intrusive::set < TaskEntry, TaskDeferListOption, boost::intrusive::compare < TaskDeferEntryCmp > > | TaskDeferList |
It is a tree of TaskEntries deferred and waiting on the containing task to exit. The tree is sorted by seqno_ of first task in the TaskEntry. More... | |
Private Member Functions | |
DISALLOW_COPY_AND_ASSIGN (TaskEntry) | |
Private Attributes | |
boost::intrusive::set_member_hook | task_defer_node |
int | task_id_ |
int | task_instance_ |
int | run_count_ |
No. of tasks running. More... | |
Task * | run_task_ |
Task currently running. More... | |
TaskWaitQ | waitq_ |
Tasks waiting to run on some condition. More... | |
TaskEntryList | policyq_ |
Policy rules for a task. More... | |
TaskDeferList * | deferq_ |
Tasks deferred for this to exit. More... | |
TaskEntry * | deferq_task_entry_ |
TaskGroup * | deferq_task_group_ |
bool | disable_ |
TaskStats | stats_ |
Cummulative Maintenance stats. More... | |
Friends | |
class | TaskGroup |
class | TaskScheduler |
A class maintaning information for every <task, instance>
policyq_ : contains,
waitq_ : Tasks of this instance created and waiting to be executed. Tasks are stored and executed in order of their creation Task can be added here on Enqueue if policy conditions are not met. Its taken out from waitq_ only when its about to Run
deferq_ : Tree of TaskEntry waiting on this task instance. The TaskEntry. This tree is populated if all conditions are met
run_task_ : Task running in context of this TaskEntry. Only entries in task_entry_db_ have this set. Entries in task_db_ will always have this as NULL Running task is not in waitq_ or deferq_
run_count_: Number of running tasks for this TaskEntry
|
private |
|
private |
|
private |
|
private |
void TaskEntry::AddToDeferQ | ( | TaskEntry * | entry | ) |
void TaskEntry::AddToWaitQ | ( | Task * | t | ) |
bool TaskEntry::DeferOnPolicyFail | ( | Task * | t | ) |
void TaskEntry::DeleteFromDeferQ | ( | TaskEntry & | entry | ) |
|
private |
void TaskEntry::GetSandeshData | ( | SandeshTaskEntry * | resp | ) | const |
boost::optional< uint64_t > TaskEntry::GetTaskDeferEntrySeqno | ( | ) | const |
Addition/deletion of TaskEntry in the deferq_ is based on the seqno. seqno of the first Task in the waitq_ is used as the key. This function would be invoked by the comparison function during addition/deletion of TaskEntry in the deferq_.
Definition at line 1517 of file task.cc.
void TaskEntry::RunCombinedDeferQ | ( | ) |
void TaskEntry::RunDeferEntry | ( | ) |
void TaskEntry::RunDeferQ | ( | ) |
void TaskEntry::RunDeferQForGroupEnable | ( | ) |
void TaskEntry::RunTask | ( | Task * | t | ) |
void TaskEntry::RunWaitQ | ( | ) |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |