diff --git a/orchagent/orch.cpp b/orchagent/orch.cpp index 73fcf45e793..235b4661d1d 100644 --- a/orchagent/orch.cpp +++ b/orchagent/orch.cpp @@ -364,10 +364,6 @@ void Orch::addConsumer(DBConnector *db, string tableName, int pri) { addExecutor(tableName, new Consumer(new SubscriberStateTable(db, tableName, TableConsumable::DEFAULT_POP_BATCH_SIZE, pri), this)); } - else if (tableName == APP_PORT_TABLE_NAME) - { - addExecutor(tableName, new Consumer(new ConsumerTable(db, tableName, gBatchSize, pri), this)); - } else { addExecutor(tableName, new Consumer(new ConsumerStateTable(db, tableName, gBatchSize, pri), this)); diff --git a/portsyncd/linksync.h b/portsyncd/linksync.h index e20dac01798..5b31ed9b3c7 100644 --- a/portsyncd/linksync.h +++ b/portsyncd/linksync.h @@ -2,7 +2,7 @@ #define __LINKSYNC__ #include "dbconnector.h" -#include "producertable.h" +#include "producerstatetable.h" #include "netmsg.h" #include @@ -19,7 +19,7 @@ class LinkSync : public NetMsg virtual void onMsg(int nlmsg_type, struct nl_object *obj); private: - ProducerTable m_portTableProducer; + ProducerStateTable m_portTableProducer; Table m_portTable, m_statePortTable; std::map m_ifindexNameMap; diff --git a/portsyncd/portsyncd.cpp b/portsyncd/portsyncd.cpp index 991e81b05fb..c49ba3da68b 100644 --- a/portsyncd/portsyncd.cpp +++ b/portsyncd/portsyncd.cpp @@ -11,7 +11,6 @@ #include "netdispatcher.h" #include "netlink.h" #include "producerstatetable.h" -#include "producertable.h" #include "portsyncd/linksync.h" #include "subscriberstatetable.h" #include "exec.h" @@ -39,11 +38,10 @@ void usage() cout << " use configDB data if not specified" << endl; } -// TODO: find a common base class for ProducerTable and ProducerStateTable -void handlePortConfigFile(ProducerTable &p, string file); -void handlePortConfigFromConfigDB(ProducerTable &p, DBConnector &cfgDb); +void handlePortConfigFile(ProducerStateTable &p, string file); +void handlePortConfigFromConfigDB(ProducerStateTable &p, DBConnector &cfgDb); void handleVlanIntfFile(string file); -void handlePortConfig(ProducerTable &p, map &port_cfg_map); +void handlePortConfig(ProducerStateTable &p, map &port_cfg_map); int main(int argc, char **argv) { @@ -71,7 +69,7 @@ int main(int argc, char **argv) DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0); DBConnector appl_db(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0); DBConnector state_db(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0); - ProducerTable p(&appl_db, APP_PORT_TABLE_NAME); + ProducerStateTable p(&appl_db, APP_PORT_TABLE_NAME); SubscriberStateTable portCfg(&cfgDb, CFG_PORT_TABLE_NAME); LinkSync sync(&appl_db, &state_db); @@ -159,7 +157,7 @@ int main(int argc, char **argv) return 1; } -static void notifyPortConfigDone(ProducerTable &p) +static void notifyPortConfigDone(ProducerStateTable &p) { /* Notify that all ports added */ FieldValueTuple finish_notice("count", to_string(g_portSet.size())); @@ -167,7 +165,7 @@ static void notifyPortConfigDone(ProducerTable &p) p.set("PortConfigDone", attrs); } -void handlePortConfigFromConfigDB(ProducerTable &p, DBConnector &cfgDb) +void handlePortConfigFromConfigDB(ProducerStateTable &p, DBConnector &cfgDb) { cout << "Get port configuration from ConfigDB..." << endl; @@ -190,7 +188,7 @@ void handlePortConfigFromConfigDB(ProducerTable &p, DBConnector &cfgDb) notifyPortConfigDone(p); } -void handlePortConfigFile(ProducerTable &p, string file) +void handlePortConfigFile(ProducerStateTable &p, string file) { cout << "Read port configuration file..." << endl; @@ -275,7 +273,7 @@ void handlePortConfigFile(ProducerTable &p, string file) notifyPortConfigDone(p); } -void handlePortConfig(ProducerTable &p, map &port_cfg_map) +void handlePortConfig(ProducerStateTable &p, map &port_cfg_map) { auto it = port_cfg_map.begin(); diff --git a/tests/test_port_an.py b/tests/test_port_an.py index c79f4a47bf9..b9912caf173 100644 --- a/tests/test_port_an.py +++ b/tests/test_port_an.py @@ -6,7 +6,7 @@ def test_PortAutoNeg(dvs): db = swsscommon.DBConnector(0, dvs.redis_sock, 0) - tbl = swsscommon.ProducerTable(db, "PORT_TABLE") + tbl = swsscommon.ProducerStateTable(db, "PORT_TABLE") # set autoneg = false and speed = 1000 fvs = swsscommon.FieldValuePairs([("autoneg","1"), ("speed", "1000")]) @@ -31,7 +31,7 @@ def test_PortAutoNeg(dvs): # set speed = 100 fvs = swsscommon.FieldValuePairs([("speed", "100")]) - + tbl.set("Ethernet0", fvs) time.sleep(1)