5 #include <boost/uuid/uuid_io.hpp>
6 #include <boost/scoped_ptr.hpp>
7 #include <vnc_cfg_types.h>
48 mgr_(mgr), link_table_(NULL), agent_(agent) {
53 if (link->
left() == node)
return link->
right();
54 if (link->
right() == node)
return link->
left();
67 std::ostringstream key_with_node_in_right;
68 key_with_node_in_right << type <<
",," << node->
ToString();
70 if (link && (strcmp(link->
metadata().c_str(),
type) == 0))
73 std::ostringstream key_with_node_in_left;
74 key_with_node_in_left << type <<
"," << node->
ToString() <<
",";
76 if (link && (strcmp(link->
metadata().c_str(),
type) == 0))
110 assert(
list_.size() == 0);
135 while (weight && (it !=
list_.end())) {
204 assert(
list_.size() == 0);
224 while (weight && (it !=
list_.end())) {
248 agent_(agent), trigger_(), timer_(NULL), timeout_(kMinTimeout) {
255 "Config Manager", task_id, 0);
398 return (
Size() == 0);
413 count +=
sg_list_->Process(max_count - count);
414 count +=
tag_list_->Process(max_count - count);
419 count +=
vn_list_->Process(max_count - count);
420 count +=
vm_list_->Process(max_count - count);
421 count +=
vrf_list_->Process(max_count - count);
425 count +=
hc_list_->Process(max_count - count);
426 count +=
vmi_list_->Process(max_count - count);
429 count +=
slo_list_->Process(max_count - count);
430 count +=
mp_list_->Process(max_count - count);
555 std::stringstream str;
556 str << setw(16) <<
"CfgMgr"
557 <<
" Queue" << setw(8) <<
Size()
558 <<
" Timeout " << setw(8) <<
timeout()
561 <<
" VMI-Q " << setw(8) <<
vmi_list_->Size()
562 <<
" Enqueue " << setw(8) <<
vmi_list_->enqueue_count()
563 <<
" Process" << setw(8) <<
vmi_list_->process_count() << endl;
593 if (state->
notify() ==
false ||
606 if (table != static_cast<IFMapAgentTable *>(node->
table())) {
628 iter != node->
end(graph); ++iter) {
boost::scoped_ptr< ConfigHelper > helper_
boost::uuids::uuid uuid()
Node(IFMapDependencyManager::IFMapNodePtr state)
bool IsRegistered(const IFMapNode *node)
IFMapAgentLinkTable * link_table_
void AddBgpRouterConfigNode(IFMapNode *node)
void AddNetworkIpamNode(IFMapNode *node)
void ProcessConfig(const boost::uuids::uuid &dev, const boost::uuids::uuid &vn)
OperIFMapTable * oper_ifmap_table_
std::unique_ptr< TaskTrigger > trigger_
ConfigManager(Agent *agent)
const std::string & metadata() const
std::unique_ptr< ConfigManagerNodeList > network_ipam_list_
void AddVirtualDnsNode(IFMapNode *node)
void AddHealthCheckServiceNode(IFMapNode *node)
IFMapNodeState * IFMapNodeGet(IFMapNode *node)
std::unique_ptr< ConfigManagerNodeList > tag_list_
std::set< DeviceVnEntry, DeviceVnEntryCmp > DeviceVnList
virtual std::string ToString() const
std::unique_ptr< ConfigManagerNodeList > qos_config_list_
PhysicalDeviceTable * physical_device_table() const
uint32_t LogicalInterfaceNodeCount() const
void AddVrfNode(IFMapNode *node)
bool oper_db_request_enqueued() const
bool operator()(const DeviceVnEntry &lhs, const DeviceVnEntry &rhs) const
void AddPhysicalInterfaceNode(IFMapNode *node)
uint32_t PhysicalDeviceVnCount() const
GlobalQosConfig * global_qos_config() const
DISALLOW_COPY_AND_ASSIGN(ConfigManagerNodeList)
static const uint32_t kMaxTimeout
std::unique_ptr< ConfigManagerNodeList > global_qos_config_list_
virtual const char * Typename() const =0
boost::asio::io_context * io_service()
IFMapDependencyManager::IFMapNodePtr state_
void AddGlobalQosConfigNode(IFMapNode *node)
InterfaceTable * interface_table() const
bool Enqueue(DBRequest *req)
void AddBridgeDomainNode(IFMapNode *node)
bool CanUseNode(IFMapNode *node)
VnTable * vn_table() const
ConfigManagerNodeList(OperIFMapTable *table)
uint32_t enqueue_count() const
void AddPhysicalDeviceVn(const boost::uuids::uuid &dev, const boost::uuids::uuid &vn)
adjacency_iterator end(DBGraph *graph)
void AddLogicalInterfaceNode(IFMapNode *node)
static const uint32_t kIterationCount
std::unique_ptr< ConfigManagerNodeList > vmi_list_
DeviceVnList::iterator DeviceVnIterator
std::string ProfileInfo() const
void AddVirtualRouterNode(IFMapNode *node)
bool Delete(Agent *agent, ConfigManager *mgr, const boost::uuids::uuid &dev, const boost::uuids::uuid &vn)
TagTable * tag_table() const
QosQueueTable * qos_queue_table() const
static const uint32_t kMinTimeout
PhysicalDeviceVnTable * table_
int GetTaskId(const std::string &name)
ConfigHelper(const ConfigManager *mgr, const Agent *agent)
IFMapNode * FindLink(const char *type, IFMapNode *node)
IFMapDependencyManager * dependency_manager()
const DBGraph * GetGraph() const
void AddForwardingClassNode(IFMapNode *node)
BgpRouterConfig * bgp_router_config() const
void AddGlobalVrouterNode(IFMapNode *node)
IFMapNode * FindAdjacentIFMapNode(IFMapNode *node, const char *type)
GlobalVrouter * global_vrouter() const
void AddQosQueueNode(IFMapNode *node)
VRouter * vrouter() const
PolicySetTable * policy_set_table() const
void AddPhysicalDeviceNode(IFMapNode *node)
std::unique_ptr< ConfigManagerNodeList > vrf_list_
void AddSecurityLoggingObjectNode(IFMapNode *node)
std::unique_ptr< ConfigManagerNodeList > forwarding_class_list_
void AddMulticastPolicyNode(IFMapNode *node)
OperNetworkIpam * network_ipam() const
std::unique_ptr< ConfigManagerNodeList > global_system_config_list_
static TaskScheduler * GetInstance()
uint32_t VmiNodeCount() const
bool Add(Agent *agent, ConfigManager *mgr, const boost::uuids::uuid &dev, const boost::uuids::uuid &vn)
uint32_t process_count() const
BridgeDomainTable * bridge_domain_table() const
uint32_t ProcessCount() const
void AddVmNode(IFMapNode *node)
bool operator()(const Node &lhs, const Node &rhs) const
IFMapNode * GetOtherAdjacentNode(IFMapLink *link, IFMapNode *node)
ConfigManagerDeviceVnList(PhysicalDeviceVnTable *table)
EventManager * event_manager() const
void AddVmiNode(IFMapNode *node)
void ProcessConfig(IFMapNode *node)
PhysicalDeviceVnTable * physical_device_vn_table() const
DeviceVnEntry(const boost::uuids::uuid &dev, const boost::uuids::uuid &vn)
void AddGlobalSystemConfigNode(IFMapNode *node)
std::unique_ptr< ConfigManagerNodeList > bridge_domain_list_
uint32_t enqueue_count() const
std::unique_ptr< ConfigManagerNodeList > vm_list_
std::unique_ptr< ConfigManagerNodeList > virtual_router_list_
std::unique_ptr< ConfigManagerNodeList > global_vrouter_list_
std::unique_ptr< ConfigManagerNodeList > qos_queue_list_
std::unique_ptr< ConfigManagerNodeList > device_list_
static Timer * CreateTimer(boost::asio::io_context &service, const std::string &name, int task_id=Timer::GetTimerTaskId(), int task_instance=Timer::GetTimerInstanceId(), bool delete_on_completion=false)
std::unique_ptr< ConfigManagerNodeList > policy_set_list_
std::unique_ptr< ConfigManagerDeviceVnList > device_vn_list_
IFMapNodePtr SetState(IFMapNode *node)
~ConfigManagerDeviceVnList()
VrfTable * vrf_table() const
std::unique_ptr< ConfigManagerNodeList > sg_list_
std::unique_ptr< ConfigManagerNodeList > virtual_dns_list_
std::unique_ptr< ConfigManagerNodeList > hc_list_
OperVirtualDns * virtual_dns() const
HealthCheckTable * health_check_table() const
uint64_t process_config_count_[kMaxTimeout+1]
void AddQosConfigNode(IFMapNode *node)
AgentQosConfigTable * qos_config_table() const
boost::intrusive_ptr< IFMapNodeState > IFMapNodePtr
SecurityLoggingObjectTable * slo_table() const
uint32_t Process(uint32_t weight)
#define IFMAP_AGENT_LINK_DB_NAME
bool Start(int time, Handler handler, ErrorHandler error_handler=NULL)
std::unique_ptr< ConfigManagerNodeList > bgp_router_config_list_
NodeList::iterator NodeListIterator
void AddTagNode(IFMapNode *node)
SgTable * sg_table() const
void PropogateNodeAndLinkChange(IFMapNode *node)
ConfigManagerNodeList(AgentDBTable *table)
std::unique_ptr< ConfigManagerNodeList > slo_list_
std::unique_ptr< ConfigManagerNodeList > vn_list_
virtual bool ProcessConfig(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
bool ResourceManagerReady() const
uint32_t process_count() const
std::unique_ptr< ConfigManagerNodeList > physical_interface_list_
void DelPhysicalDeviceVn(const boost::uuids::uuid &dev, const boost::uuids::uuid &vn)
ForwardingClassTable * forwarding_class_table() const
bool Reschedule(int time)
bool Delete(Agent *agent, ConfigManager *mgr, IFMapNode *node)
MulticastPolicyTable * mp_table() const
void AddSgNode(IFMapNode *node)
std::unique_ptr< ConfigManagerNodeList > logical_interface_list_
void AddVnNode(IFMapNode *node)
bool SkipNode(IFMapNode *node)
bool Add(Agent *agent, ConfigManager *mgr, IFMapNode *node)
void NodeResync(IFMapNode *node)
IFMapLink * FindNextLink(const std::string &name)
adjacency_iterator begin(DBGraph *graph)
void AddPolicySetNode(IFMapNode *node)
GlobalSystemConfig * global_system_config() const
std::set< Node, NodeCmp > NodeList
VmTable * vm_table() const
std::unique_ptr< ConfigManagerNodeList > mp_list_
DISALLOW_COPY_AND_ASSIGN(ConfigManagerDeviceVnList)
static bool DeleteTimer(Timer *Timer)
uint32_t Process(uint32_t weight)