Skip to content

Commit fc085ee

Browse files
dzhangalibabaqiluo-msft
authored andcommitted
[MultiDB]: using new APIs in orch agents and mocktest (sonic-net#1138)
1 parent 3c2966f commit fc085ee

34 files changed

+150
-76
lines changed

cfgmgr/buffermgrd.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ int main(int argc, char **argv)
7878
CFG_PORT_CABLE_LEN_TABLE_NAME,
7979
};
8080

81-
DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
82-
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
81+
DBConnector cfgDb("CONFIG_DB", 0);
82+
DBConnector stateDb("STATE_DB", 0);
8383

8484
BufferMgr buffmgr(&cfgDb, &stateDb, pg_lookup_file, cfg_buffer_tables);
8585

cfgmgr/intfmgrd.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ int main(int argc, char **argv)
4848
CFG_VLAN_SUB_INTF_TABLE_NAME,
4949
};
5050

51-
DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
52-
DBConnector appDb(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
53-
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
51+
DBConnector cfgDb("CONFIG_DB", 0);
52+
DBConnector appDb("APPL_DB", 0);
53+
DBConnector stateDb("STATE_DB", 0);
5454

5555
IntfMgr intfmgr(&cfgDb, &appDb, &stateDb, cfg_intf_tables);
5656

cfgmgr/nbrmgrd.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ int main(int argc, char **argv)
4949
CFG_NEIGH_TABLE_NAME,
5050
};
5151

52-
DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
53-
DBConnector appDb(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
54-
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
52+
DBConnector cfgDb("CONFIG_DB", 0);
53+
DBConnector appDb("APPL_DB", 0);
54+
DBConnector stateDb("STATE_DB", 0);
5555

5656
NbrMgr nbrmgr(&cfgDb, &appDb, &stateDb, cfg_nbr_tables);
5757

cfgmgr/portmgrd.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ int main(int argc, char **argv)
4444
CFG_PORT_TABLE_NAME,
4545
};
4646

47-
DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
48-
DBConnector appDb(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
49-
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
47+
DBConnector cfgDb("CONFIG_DB", 0);
48+
DBConnector appDb("APPL_DB", 0);
49+
DBConnector stateDb("STATE_DB", 0);
5050

5151
PortMgr portmgr(&cfgDb, &appDb, &stateDb, cfg_port_tables);
5252

cfgmgr/sflowmgrd.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ int main(int argc, char **argv)
4646
CFG_PORT_TABLE_NAME
4747
};
4848

49-
DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
50-
DBConnector appDb(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
49+
DBConnector cfgDb("CONFIG_DB", 0);
50+
DBConnector appDb("APPL_DB", 0);
5151

5252
SflowMgr sflowmgr(&cfgDb, &appDb, cfg_sflow_tables);
5353

cfgmgr/teammgrd.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ int main(int argc, char **argv)
2626

2727
try
2828
{
29-
DBConnector conf_db(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
30-
DBConnector app_db(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
31-
DBConnector state_db(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
29+
DBConnector conf_db("CONFIG_DB", 0);
30+
DBConnector app_db("APPL_DB", 0);
31+
DBConnector state_db("STATE_DB", 0);
3232

3333
WarmStart::initialize("teammgrd", "teamd");
3434
WarmStart::checkWarmStart("teammgrd", "teamd");

cfgmgr/vlanmgrd.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ int main(int argc, char **argv)
5353
CFG_VLAN_MEMBER_TABLE_NAME,
5454
};
5555

56-
DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
57-
DBConnector appDb(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
58-
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
56+
DBConnector cfgDb("CONFIG_DB", 0);
57+
DBConnector appDb("APPL_DB", 0);
58+
DBConnector stateDb("STATE_DB", 0);
5959

6060
WarmStart::initialize("vlanmgrd", "swss");
6161
WarmStart::checkWarmStart("vlanmgrd", "swss");

cfgmgr/vrfmgrd.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ int main(int argc, char **argv)
4545
CFG_VNET_TABLE_NAME,
4646
};
4747

48-
DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
49-
DBConnector appDb(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
50-
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
48+
DBConnector cfgDb("CONFIG_DB", 0);
49+
DBConnector appDb("APPL_DB", 0);
50+
DBConnector stateDb("STATE_DB", 0);
5151

5252
VrfMgr vrfmgr(&cfgDb, &appDb, &stateDb, cfg_vrf_tables);
5353

cfgmgr/vxlanmgrd.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ int main(int argc, char **argv)
4545
try
4646
{
4747

48-
DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
49-
DBConnector appDb(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
50-
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
48+
DBConnector cfgDb("CONFIG_DB", 0);
49+
DBConnector appDb("APPL_DB", 0);
50+
DBConnector stateDb("STATE_DB", 0);
5151

5252
vector<std::string> cfg_vnet_tables = {
5353
CFG_VNET_TABLE_NAME,

fpmsyncd/fpmsyncd.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ static bool eoiuFlagsSet(Table &bgpStateTable)
4747
int main(int argc, char **argv)
4848
{
4949
swss::Logger::linkToDbNative("fpmsyncd");
50-
DBConnector db(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
50+
DBConnector db("APPL_DB", 0);
5151
RedisPipeline pipeline(&db);
5252
RouteSync sync(&pipeline);
5353

54-
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
54+
DBConnector stateDb("STATE_DB", 0);
5555
Table bgpStateTable(&stateDb, STATE_BGP_TABLE_NAME);
5656

5757
NetDispatcher::getInstance().registerMessageHandler(RTM_NEWROUTE, &sync);

neighsyncd/neighsyncd.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ int main(int argc, char **argv)
1515
{
1616
Logger::linkToDbNative("neighsyncd");
1717

18-
DBConnector appDb(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
18+
DBConnector appDb("APPL_DB", 0);
1919
RedisPipeline pipelineAppDB(&appDb);
20-
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
20+
DBConnector stateDb("STATE_DB", 0);
2121

2222
NeighSync sync(&pipelineAppDB, &stateDb);
2323

orchagent/aclorch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ bool AclOrch::m_bCollectCounters = true;
2222
sai_uint32_t AclRule::m_minPriority = 0;
2323
sai_uint32_t AclRule::m_maxPriority = 0;
2424

25-
swss::DBConnector AclOrch::m_db(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
25+
swss::DBConnector AclOrch::m_db("COUNTERS_DB", 0);
2626
swss::Table AclOrch::m_countersTable(&m_db, "COUNTERS");
2727

2828
extern sai_acl_api_t* sai_acl_api;

orchagent/bufferorch.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ type_map BufferOrch::m_buffer_type_maps = {
3636

3737
BufferOrch::BufferOrch(DBConnector *db, vector<string> &tableNames) :
3838
Orch(db, tableNames),
39-
m_flexCounterDb(new DBConnector(FLEX_COUNTER_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
39+
m_flexCounterDb(new DBConnector("FLEX_COUNTER_DB", 0)),
4040
m_flexCounterTable(new ProducerTable(m_flexCounterDb.get(), FLEX_COUNTER_TABLE)),
4141
m_flexCounterGroupTable(new ProducerTable(m_flexCounterDb.get(), FLEX_COUNTER_GROUP_TABLE)),
42-
m_countersDb(new DBConnector(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
42+
m_countersDb(new DBConnector("COUNTERS_DB", 0)),
4343
m_countersDbRedisClient(m_countersDb.get())
4444
{
4545
SWSS_LOG_ENTER();

orchagent/countercheckorch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ CounterCheckOrch& CounterCheckOrch::getInstance(DBConnector *db)
2424

2525
CounterCheckOrch::CounterCheckOrch(DBConnector *db, vector<string> &tableNames):
2626
Orch(db, tableNames),
27-
m_countersDb(new DBConnector(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
27+
m_countersDb(new DBConnector("COUNTERS_DB", 0)),
2828
m_countersTable(new Table(m_countersDb.get(), COUNTERS_TABLE))
2929
{
3030
SWSS_LOG_ENTER();

orchagent/crmorch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ const map<string, CrmResourceType> crmUsedCntsTableMap =
151151

152152
CrmOrch::CrmOrch(DBConnector *db, string tableName):
153153
Orch(db, tableName),
154-
m_countersDb(new DBConnector(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
154+
m_countersDb(new DBConnector("COUNTERS_DB", 0)),
155155
m_countersCrmTable(new Table(m_countersDb.get(), COUNTERS_CRM_TABLE)),
156156
m_timer(new SelectableTimer(timespec { .tv_sec = CRM_POLLING_INTERVAL_DEFAULT, .tv_nsec = 0 }))
157157
{

orchagent/debugcounterorch.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ static const unordered_map<string, CounterType> flex_counter_type_lookup = {
2626
DebugCounterOrch::DebugCounterOrch(DBConnector *db, const vector<string>& table_names, int poll_interval) :
2727
Orch(db, table_names),
2828
flex_counter_manager(DEBUG_COUNTER_FLEX_COUNTER_GROUP, StatsMode::READ, poll_interval),
29-
m_stateDb(new DBConnector(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
29+
m_stateDb(new DBConnector("STATE_DB", 0)),
3030
m_debugCapabilitiesTable(new Table(m_stateDb.get(), STATE_DEBUG_COUNTER_CAPABILITIES_NAME)),
31-
m_countersDb(new DBConnector(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
31+
m_countersDb(new DBConnector("COUNTERS_DB", 0)),
3232
m_counterNameToPortStatMap(new Table(m_countersDb.get(), COUNTERS_DEBUG_NAME_PORT_STAT_MAP)),
3333
m_counterNameToSwitchStatMap(new Table(m_countersDb.get(), COUNTERS_DEBUG_NAME_SWITCH_STAT_MAP))
3434
{
@@ -585,4 +585,4 @@ bool DebugCounterOrch::isDropReasonValid(const string& drop_reason) const
585585
}
586586

587587
return true;
588-
}
588+
}

orchagent/fdborch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ FdbOrch::FdbOrch(TableConnector applDbConnector, TableConnector stateDbConnector
3232
Orch::addExecutor(flushNotifier);
3333

3434
/* Add FDB notifications support from ASIC */
35-
DBConnector *notificationsDb = new DBConnector(ASIC_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
35+
DBConnector *notificationsDb = new DBConnector("ASIC_DB", 0);
3636
m_fdbNotificationConsumer = new swss::NotificationConsumer(notificationsDb, "NOTIFICATIONS");
3737
auto fdbNotifier = new Notifier(m_fdbNotificationConsumer, this, "FDB_NOTIFICATIONS");
3838
Orch::addExecutor(fdbNotifier);

orchagent/flex_counter/flex_counter_manager.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ FlexCounterManager::FlexCounterManager(
4545
stats_mode(stats_mode),
4646
polling_interval(polling_interval),
4747
enabled(false),
48-
flex_counter_db(new DBConnector(FLEX_COUNTER_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
48+
flex_counter_db(new DBConnector("FLEX_COUNTER_DB", 0)),
4949
flex_counter_group_table(new ProducerTable(flex_counter_db.get(), FLEX_COUNTER_GROUP_TABLE)),
5050
flex_counter_table(new ProducerTable(flex_counter_db.get(), FLEX_COUNTER_TABLE))
5151
{
@@ -222,4 +222,4 @@ string FlexCounterManager::serializeCounterStats(
222222
}
223223

224224
return stats_string;
225-
}
225+
}

orchagent/flexcounterorch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ unordered_map<string, string> flexCounterGroupMap =
3333

3434
FlexCounterOrch::FlexCounterOrch(DBConnector *db, vector<string> &tableNames):
3535
Orch(db, tableNames),
36-
m_flexCounterDb(new DBConnector(FLEX_COUNTER_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
36+
m_flexCounterDb(new DBConnector("FLEX_COUNTER_DB", 0)),
3737
m_flexCounterGroupTable(new ProducerTable(m_flexCounterDb.get(), FLEX_COUNTER_GROUP_TABLE))
3838
{
3939
SWSS_LOG_ENTER();

orchagent/intfsorch.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ IntfsOrch::IntfsOrch(DBConnector *db, string tableName, VRFOrch *vrf_orch) :
5555
SWSS_LOG_ENTER();
5656

5757
/* Initialize DB connectors */
58-
m_counter_db = shared_ptr<DBConnector>(new DBConnector(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0));
59-
m_flex_db = shared_ptr<DBConnector>(new DBConnector(FLEX_COUNTER_DB, DBConnector::DEFAULT_UNIXSOCKET, 0));
60-
m_asic_db = shared_ptr<DBConnector>(new DBConnector(ASIC_DB, DBConnector::DEFAULT_UNIXSOCKET, 0));
58+
m_counter_db = shared_ptr<DBConnector>(new DBConnector("COUNTERS_DB", 0));
59+
m_flex_db = shared_ptr<DBConnector>(new DBConnector("FLEX_COUNTER_DB", 0));
60+
m_asic_db = shared_ptr<DBConnector>(new DBConnector("ASIC_DB", 0));
6161
/* Initialize COUNTER_DB tables */
6262
m_rifNameTable = unique_ptr<Table>(new Table(m_counter_db.get(), COUNTERS_RIF_NAME_MAP));
6363
m_rifTypeTable = unique_ptr<Table>(new Table(m_counter_db.get(), COUNTERS_RIF_TYPE_MAP));

orchagent/main.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,9 @@ int main(int argc, char **argv)
291291
SWSS_LOG_NOTICE("Created underlay router interface ID %" PRIx64, gUnderlayIfId);
292292

293293
/* Initialize orchestration components */
294-
DBConnector appl_db(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
295-
DBConnector config_db(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
296-
DBConnector state_db(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
294+
DBConnector appl_db("APPL_DB", 0);
295+
DBConnector config_db("CONFIG_DB", 0);
296+
DBConnector state_db("STATE_DB", 0);
297297

298298
auto orchDaemon = make_shared<OrchDaemon>(&appl_db, &config_db, &state_db);
299299

orchagent/orchagent_restart_check.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ int main(int argc, char **argv)
105105
}
106106
}
107107

108-
swss::DBConnector db(APPL_DB, swss::DBConnector::DEFAULT_UNIXSOCKET, 0);
108+
swss::DBConnector db("APPL_DB", 0);
109109
// Send warm restart query via "RESTARTCHECK" notification channel
110110
swss::NotificationProducer restartQuery(&db, "RESTARTCHECK");
111111
// Will listen for the reply on "RESTARTCHECKREPLY" channel

orchagent/pfcwdorch.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ extern PortsOrch *gPortsOrch;
3636
template <typename DropHandler, typename ForwardHandler>
3737
PfcWdOrch<DropHandler, ForwardHandler>::PfcWdOrch(DBConnector *db, vector<string> &tableNames):
3838
Orch(db, tableNames),
39-
m_countersDb(new DBConnector(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
39+
m_countersDb(new DBConnector("COUNTERS_DB", 0)),
4040
m_countersTable(new Table(m_countersDb.get(), COUNTERS_TABLE))
4141
{
4242
SWSS_LOG_ENTER();
@@ -652,14 +652,14 @@ PfcWdSwOrch<DropHandler, ForwardHandler>::PfcWdSwOrch(
652652
const vector<sai_queue_attr_t> &queueAttrIds,
653653
int pollInterval):
654654
PfcWdOrch<DropHandler, ForwardHandler>(db, tableNames),
655-
m_flexCounterDb(new DBConnector(FLEX_COUNTER_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
655+
m_flexCounterDb(new DBConnector("FLEX_COUNTER_DB", 0)),
656656
m_flexCounterTable(new ProducerTable(m_flexCounterDb.get(), FLEX_COUNTER_TABLE)),
657657
m_flexCounterGroupTable(new ProducerTable(m_flexCounterDb.get(), FLEX_COUNTER_GROUP_TABLE)),
658658
c_portStatIds(portStatIds),
659659
c_queueStatIds(queueStatIds),
660660
c_queueAttrIds(queueAttrIds),
661661
m_pollInterval(pollInterval),
662-
m_applDb(make_shared<DBConnector>(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
662+
m_applDb(make_shared<DBConnector>("APPL_DB", 0)),
663663
m_applTable(make_shared<Table>(m_applDb.get(), APP_PFC_WD_TABLE_NAME "_INSTORM")),
664664
m_applDbRedisClient(m_applDb.get())
665665
{

orchagent/portsorch.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ PortsOrch::PortsOrch(DBConnector *db, vector<table_name_with_pri_t> &tableNames)
156156
SWSS_LOG_ENTER();
157157

158158
/* Initialize counter table */
159-
m_counter_db = shared_ptr<DBConnector>(new DBConnector(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0));
159+
m_counter_db = shared_ptr<DBConnector>(new DBConnector("COUNTERS_DB", 0));
160160
m_counterTable = unique_ptr<Table>(new Table(m_counter_db.get(), COUNTERS_PORT_NAME_MAP));
161161

162162
/* Initialize port table */
@@ -173,7 +173,7 @@ PortsOrch::PortsOrch(DBConnector *db, vector<table_name_with_pri_t> &tableNames)
173173
m_pgPortTable = unique_ptr<Table>(new Table(m_counter_db.get(), COUNTERS_PG_PORT_MAP));
174174
m_pgIndexTable = unique_ptr<Table>(new Table(m_counter_db.get(), COUNTERS_PG_INDEX_MAP));
175175

176-
m_flex_db = shared_ptr<DBConnector>(new DBConnector(FLEX_COUNTER_DB, DBConnector::DEFAULT_UNIXSOCKET, 0));
176+
m_flex_db = shared_ptr<DBConnector>(new DBConnector("FLEX_COUNTER_DB", 0));
177177
m_flexCounterTable = unique_ptr<ProducerTable>(new ProducerTable(m_flex_db.get(), FLEX_COUNTER_TABLE));
178178
m_flexCounterGroupTable = unique_ptr<ProducerTable>(new ProducerTable(m_flex_db.get(), FLEX_COUNTER_GROUP_TABLE));
179179

@@ -315,7 +315,7 @@ PortsOrch::PortsOrch(DBConnector *db, vector<table_name_with_pri_t> &tableNames)
315315
removeDefaultBridgePorts();
316316

317317
/* Add port oper status notification support */
318-
DBConnector *notificationsDb = new DBConnector(ASIC_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
318+
DBConnector *notificationsDb = new DBConnector("ASIC_DB", 0);
319319
m_portStatusNotificationConsumer = new swss::NotificationConsumer(notificationsDb, "NOTIFICATIONS");
320320
auto portStatusNotificatier = new Notifier(m_portStatusNotificationConsumer, this, "PORT_STATUS_NOTIFICATIONS");
321321
Orch::addExecutor(portStatusNotificatier);

orchagent/routeresync.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ int main(int argc, char **argv)
1919

2020
SWSS_LOG_ENTER();
2121

22-
DBConnector db(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
22+
DBConnector db("APPL_DB", 0);
2323
ProducerStateTable r(&db, APP_ROUTE_TABLE_NAME);
2424

2525
if (argc != 2)

orchagent/watermarkorch.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ WatermarkOrch::WatermarkOrch(DBConnector *db, const vector<string> &tables):
2323
{
2424
SWSS_LOG_ENTER();
2525

26-
m_countersDb = make_shared<DBConnector>(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
27-
m_appDb = make_shared<DBConnector>(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
26+
m_countersDb = make_shared<DBConnector>("COUNTERS_DB", 0);
27+
m_appDb = make_shared<DBConnector>("APPL_DB", 0);
2828
m_countersTable = make_shared<Table>(m_countersDb.get(), COUNTERS_TABLE);
2929
m_periodicWatermarkTable = make_shared<Table>(m_countersDb.get(), PERIODIC_WATERMARKS_TABLE);
3030
m_persistentWatermarkTable = make_shared<Table>(m_countersDb.get(), PERSISTENT_WATERMARKS_TABLE);

portsyncd/portsyncd.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ int main(int argc, char **argv)
6565
}
6666
}
6767

68-
DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
69-
DBConnector appl_db(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
70-
DBConnector state_db(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
68+
DBConnector cfgDb("CONFIG_DB", 0);
69+
DBConnector appl_db("APPL_DB", 0);
70+
DBConnector state_db("STATE_DB", 0);
7171
ProducerStateTable p(&appl_db, APP_PORT_TABLE_NAME);
7272
SubscriberStateTable portCfg(&cfgDb, CFG_PORT_TABLE_NAME);
7373

swssconfig/swssconfig.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ using namespace std;
1515
using namespace swss;
1616
using json = nlohmann::json;
1717

18-
int db_port = 6379;
19-
const char* const hostname = "localhost";
2018
const char* const op_name = "OP";
2119
const char* const name_delimiter = ":";
2220
const int el_count = 2;
@@ -43,7 +41,7 @@ void dump_db_item(KeyOpFieldsValuesTuple &db_item)
4341

4442
bool write_db_data(vector<KeyOpFieldsValuesTuple> &db_items)
4543
{
46-
DBConnector db(APPL_DB, hostname, db_port, 0);
44+
DBConnector db("APPL_DB", 0, true);
4745
for (auto &db_item : db_items)
4846
{
4947
dump_db_item(db_item);

swssconfig/swssplayer.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
using namespace std;
1010
using namespace swss;
1111

12-
constexpr int DB_PORT = 6379;
13-
constexpr char* DB_HOSTNAME = "localhost";
14-
1512
static int line_index = 0;
16-
static DBConnector db(APPL_DB, DB_HOSTNAME, DB_PORT, 0);
13+
static DBConnector db("APPL_DB", 0, true);
1714

1815
void usage()
1916
{

teamsyncd/teamsyncd.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ using namespace swss;
1212
int main(int argc, char **argv)
1313
{
1414
swss::Logger::linkToDbNative(TEAMSYNCD_APP_NAME);
15-
DBConnector db(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
16-
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
15+
DBConnector db("APPL_DB", 0);
16+
DBConnector stateDb("STATE_DB", 0);
1717
Select s;
1818
TeamSync sync(&db, &stateDb, &s);
1919

0 commit comments

Comments
 (0)