From 5631e5ce96000f09a62885850f6d3ef3aa65778b Mon Sep 17 00:00:00 2001 From: Rajesh Sankaran Date: Wed, 3 Jun 2020 00:05:19 -0700 Subject: [PATCH] Handled Review comments given on Jun 2. https://github.com/Azure/sonic-swss-common/pull/339#issuecomment-637152817 --- common/schema.h | 1 + common/warm_restart.cpp | 34 ---------------------------------- common/warm_restart.h | 5 ----- 3 files changed, 1 insertion(+), 39 deletions(-) diff --git a/common/schema.h b/common/schema.h index 45ea2eb58..6999a55bc 100644 --- a/common/schema.h +++ b/common/schema.h @@ -56,6 +56,7 @@ namespace swss { #define APP_NAT_GLOBAL_TABLE_NAME "NAT_GLOBAL_TABLE" #define APP_NAPT_POOL_IP_TABLE_NAME "NAPT_POOL_IP_TABLE" +#define APP_STP_VLAN_TABLE_NAME "STP_VLAN_TABLE" #define APP_STP_VLAN_PORT_TABLE_NAME "STP_VLAN_PORT_TABLE" #define APP_STP_VLAN_INSTANCE_TABLE_NAME "STP_VLAN_INSTANCE_TABLE" #define APP_STP_PORT_TABLE_NAME "STP_PORT_TABLE" diff --git a/common/warm_restart.cpp b/common/warm_restart.cpp index 30d393865..62aa846c1 100644 --- a/common/warm_restart.cpp +++ b/common/warm_restart.cpp @@ -195,40 +195,6 @@ void WarmStart::setWarmStartState(const std::string &app_name, WarmStartState st warmStartStateNameMap.at(state).c_str()); } -void WarmStart::getWarmStartState(const std::string &app_name, WarmStartState &state) -{ - //WarmStartStateNameMap::iterator it; - std::string statestr; - - auto& warmStart = getInstance(); - - state = RECONCILED; - - if(!isWarmStart()) - return; - - warmStart.m_stateWarmRestartTable->hget(app_name, "state", statestr); - - /* If warm-start is enabled, state cannot be assumed as Reconciled - * It should be set to unknown - */ - state = WSUNKNOWN; - - for(std::map::const_iterator it = warmStartStateNameMap.begin(); it != warmStartStateNameMap.end(); it++) - { - if(it->second == statestr) - { - state = it->first; - break; - } - } - - SWSS_LOG_INFO("%s warm start state get %s(%d)", - app_name.c_str(), statestr.c_str(), state); - - return; -} - // Set the WarmStart data check state for a particular application. void WarmStart::setDataCheckState(const std::string &app_name, DataCheckStage stage, DataCheckState state) { diff --git a/common/warm_restart.h b/common/warm_restart.h index 1b879f9ea..dd6bf7c42 100644 --- a/common/warm_restart.h +++ b/common/warm_restart.h @@ -17,7 +17,6 @@ class WarmStart INITIALIZED, RESTORED, RECONCILED, - WSUNKNOWN, }; enum DataCheckState @@ -57,10 +56,6 @@ class WarmStart static void setWarmStartState(const std::string &app_name, WarmStartState state); - static void getWarmStartState(const std::string &app_name, - WarmStartState &state); - - static uint32_t getWarmStartTimer(const std::string &app_name, const std::string &docker_name);