8 #include <boost/assign.hpp>
9 #include <sys/resource.h>
15 using process::ProcessState;
21 static bool policy_set;
30 TaskPolicy config_policy = boost::assign::list_of
56 TaskPolicy config_helper_policy = boost::assign::list_of
76 config_helper_policy);
79 TaskPolicy static_service_chain_policy = boost::assign::list_of
91 static_service_chain_policy);
93 static_service_chain_policy);
114 TaskPolicy peer_membership_policy = boost::assign::list_of
127 peer_membership_policy);
132 TaskPolicy send_update_policy = boost::assign::list_of
138 send_update_policy.push_back(
145 TaskPolicy send_ready_policy = boost::assign::list_of
155 TaskPolicy evpn_segment_policy = boost::assign::list_of
166 evpn_segment_policy);
169 TaskPolicy rtfilter_policy = boost::assign::list_of
179 TaskPolicy resolver_path_policy = boost::assign::list_of
190 resolver_path_policy);
193 TaskPolicy resolver_nexthop_policy = boost::assign::list_of
200 resolver_nexthop_policy);
203 TaskPolicy route_aggregation_policy = boost::assign::list_of
214 route_aggregation_policy);
217 TaskPolicy db_ifmap_policy = boost::assign::list_of
229 TaskPolicy walker_policy = boost::assign::list_of
248 rlimit new_core_limit;
249 new_core_limit.rlim_cur = 0;
250 new_core_limit.rlim_max = 0;
251 setrlimit(RLIMIT_CORE, &new_core_limit);
258 bool bgpIsAdminDown,
bool configEndOfRibComputed,
260 if (!configEndOfRibComputed) {
261 *state = ProcessState::NON_FUNCTIONAL;
262 (*message) += (message->empty() ?
"" :
", ") +
263 string(
"IFMap Server End-Of-RIB not computed");
266 if (!bgpHasSelfConfiguration) {
267 *state = ProcessState::NON_FUNCTIONAL;
268 (*message) += (message->empty() ?
"" :
", ") +
269 string(
"No BGP configuration for self");
272 if (bgpIsAdminDown) {
273 *state = ProcessState::NON_FUNCTIONAL;
274 (*message) += (message->empty() ?
"" :
", ") +
275 string(
"BGP is administratively down");
static std::string GetProcessState(bool bgpHasSelfConfiguration, bool bgpIsAdminDown, bool configEndOfRibComputed, process::ProcessState::type *state, std::string *message)
static void Exit(bool do_assert)
static void SetDefaultSchedulingPolicy()
static int PartitionCount()
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
int GetTaskId(const std::string &name)
void SetPolicy(int task_id, TaskPolicy &policy)
Sets the task exclusion policy. Adds policy entries for the task Examples:
static TaskScheduler * GetInstance()
int HardwareThreadCount()
The class is used to specify a Task label for formulating a task exclusion list (an execution policy)...
std::vector< TaskExclusion > TaskPolicy
Defines a type to store an execution policy (a list of task exclusions).