OpenSDN source code
|
TaskGroup maintains per <task-id> information including,. More...
Public Member Functions | |
TaskGroup (int task_id) | |
~TaskGroup () | |
TaskEntry * | QueryTaskEntry (int task_instance) const |
TaskEntry * | GetTaskEntry (int task_instance) |
void | AddPolicy (TaskGroup *group) |
void | AddToDeferQ (TaskEntry *entry) |
Add task to deferq_ Only one task of a given instance goes into deferq_ for its policies. More... | |
void | AddToDisableQ (TaskEntry *entry) |
Enqueue TaskEntry in disable_entry's deferQ. More... | |
void | AddEntriesToDisableQ () |
Add TaskEntries to disable_entry_ which have tasks enqueued and are already disabled. More... | |
TaskEntry * | GetDisableEntry () |
void | DeleteFromDeferQ (TaskEntry &entry) |
Delete task from deferq_. More... | |
TaskGroup * | ActiveGroupInPolicy () |
bool | DeferOnPolicyFail (TaskEntry *entry, Task *t) |
bool | IsWaitQEmpty () |
Returns true, if the waiq_ of all the tasks in the group are empty. More... | |
int | TaskRunCount () const |
void | RunDeferQ () |
Starts executing tasks from deferq_ of a TaskGroup. More... | |
void | RunDisableEntries () |
Run tasks that maybe suspended. Schedule tasks only for TaskEntries which are enabled. More... | |
void | TaskExited (Task *t) |
void | PolicySet () |
void | TaskStarted () |
void | IncrementTotalRunTime (int64_t rtime) |
TaskStats * | GetTaskGroupStats () |
TaskStats * | GetTaskStats () |
TaskStats * | GetTaskStats (int task_instance) |
void | ClearTaskGroupStats () |
void | ClearTaskStats () |
void | ClearTaskStats (int instance_id) |
void | SetDisable (bool disable) |
bool | IsDisabled () |
void | GetSandeshData (SandeshTaskGroup *resp, bool summary) const |
int | task_id () const |
size_t | deferq_size () const |
size_t | num_tasks () const |
Private Types | |
typedef std::vector< TaskGroup * > | TaskGroupPolicyList |
Vector of Task Group policies. More... | |
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 (TaskGroup) | |
Private Attributes | |
int | task_id_ |
bool | policy_set_ |
Specifies if policy is already set. More... | |
int | run_count_ |
No. of tasks running in the group. More... | |
tbb::atomic< uint64_t > | total_run_time_ |
TaskGroupPolicyList | policy_ |
Policy rules for the group. More... | |
TaskDeferList | deferq_ |
Tasks deferred till run_count_ is 0. More... | |
TaskEntry * | task_entry_ |
Tasks deferred till run_count_ is 0. More... | |
TaskEntry * | disable_entry_ |
Task entry for disabled group. More... | |
TaskEntryList | task_entry_db_ |
task-entries in this group More... | |
uint32_t | execute_delay_ |
uint32_t | schedule_delay_ |
bool | disable_ |
TaskStats | stats_ |
Static Private Attributes | |
static const int | kVectorGrowSize = 16 |
Friends | |
class | TaskEntry |
class | TaskScheduler |
TaskGroup maintains per <task-id> information including,.
polic_set_ : Boolean used to ensure policy is set only once per task Task policy change is not yet supported
policy_ : List of policy rules for the task
run_count_ : Number of tasks running in context of this task-group
deferq_ : Tasks deferred till run_count_ on this task becomes 0
task_entry_ : Default TaskEntry used for task without an instance
disable_entry_ : TaskEntry which maintains a deferQ for tasks enqueued while TaskGroup is disabled
|
private |
|
private |
|
private |
void TaskGroup::AddEntriesToDisableQ | ( | ) |
void TaskGroup::AddToDeferQ | ( | TaskEntry * | entry | ) |
void TaskGroup::AddToDisableQ | ( | TaskEntry * | entry | ) |
void TaskGroup::ClearTaskStats | ( | ) |
void TaskGroup::ClearTaskStats | ( | int | instance_id | ) |
void TaskGroup::DeleteFromDeferQ | ( | TaskEntry & | entry | ) |
|
private |
void TaskGroup::GetSandeshData | ( | SandeshTaskGroup * | resp, |
bool | summary | ||
) | const |
TaskStats * TaskGroup::GetTaskStats | ( | ) |
TaskStats * TaskGroup::GetTaskStats | ( | int | task_instance | ) |
|
inline |
bool TaskGroup::IsWaitQEmpty | ( | ) |
Returns true, if the waiq_ of all the tasks in the group are empty.
Note: This function is invoked from TaskScheduler::IsEmpty() for each task group and is intended to be invoked only in the test code. If this function needs to be used outside test code, then we may want to consider storing the waitq_ count for performance reason.
Definition at line 1206 of file task.cc.
TaskEntry * TaskGroup::QueryTaskEntry | ( | int | task_instance | ) | const |
void TaskGroup::RunDeferQ | ( | ) |
void TaskGroup::RunDisableEntries | ( | ) |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |