Skip to content

Commit

Permalink
[MultiDB]: using new APIs in orch agents and mocktest (sonic-net#1138)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhangalibaba authored and abdosi committed Dec 31, 2019
1 parent c3b8fe1 commit 2412ef9
Show file tree
Hide file tree
Showing 34 changed files with 150 additions and 76 deletions.
4 changes: 2 additions & 2 deletions cfgmgr/buffermgrd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ int main(int argc, char **argv)
CFG_PORT_CABLE_LEN_TABLE_NAME,
};

DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector cfgDb("CONFIG_DB", 0);
DBConnector stateDb("STATE_DB", 0);

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

Expand Down
6 changes: 3 additions & 3 deletions cfgmgr/intfmgrd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ int main(int argc, char **argv)
CFG_VLAN_SUB_INTF_TABLE_NAME,
};

DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector appDb(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector cfgDb("CONFIG_DB", 0);
DBConnector appDb("APPL_DB", 0);
DBConnector stateDb("STATE_DB", 0);

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

Expand Down
6 changes: 3 additions & 3 deletions cfgmgr/nbrmgrd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ int main(int argc, char **argv)
CFG_NEIGH_TABLE_NAME,
};

DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector appDb(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector cfgDb("CONFIG_DB", 0);
DBConnector appDb("APPL_DB", 0);
DBConnector stateDb("STATE_DB", 0);

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

Expand Down
6 changes: 3 additions & 3 deletions cfgmgr/portmgrd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ int main(int argc, char **argv)
CFG_PORT_TABLE_NAME,
};

DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector appDb(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector cfgDb("CONFIG_DB", 0);
DBConnector appDb("APPL_DB", 0);
DBConnector stateDb("STATE_DB", 0);

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

Expand Down
4 changes: 2 additions & 2 deletions cfgmgr/sflowmgrd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ int main(int argc, char **argv)
CFG_PORT_TABLE_NAME
};

DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector appDb(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector cfgDb("CONFIG_DB", 0);
DBConnector appDb("APPL_DB", 0);

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

Expand Down
6 changes: 3 additions & 3 deletions cfgmgr/teammgrd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ int main(int argc, char **argv)

try
{
DBConnector conf_db(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector app_db(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector state_db(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector conf_db("CONFIG_DB", 0);
DBConnector app_db("APPL_DB", 0);
DBConnector state_db("STATE_DB", 0);

WarmStart::initialize("teammgrd", "teamd");
WarmStart::checkWarmStart("teammgrd", "teamd");
Expand Down
6 changes: 3 additions & 3 deletions cfgmgr/vlanmgrd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ int main(int argc, char **argv)
CFG_VLAN_MEMBER_TABLE_NAME,
};

DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector appDb(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector cfgDb("CONFIG_DB", 0);
DBConnector appDb("APPL_DB", 0);
DBConnector stateDb("STATE_DB", 0);

WarmStart::initialize("vlanmgrd", "swss");
WarmStart::checkWarmStart("vlanmgrd", "swss");
Expand Down
6 changes: 3 additions & 3 deletions cfgmgr/vrfmgrd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ int main(int argc, char **argv)
CFG_VNET_TABLE_NAME,
};

DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector appDb(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector cfgDb("CONFIG_DB", 0);
DBConnector appDb("APPL_DB", 0);
DBConnector stateDb("STATE_DB", 0);

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

Expand Down
6 changes: 3 additions & 3 deletions cfgmgr/vxlanmgrd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ int main(int argc, char **argv)
try
{

DBConnector cfgDb(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector appDb(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector cfgDb("CONFIG_DB", 0);
DBConnector appDb("APPL_DB", 0);
DBConnector stateDb("STATE_DB", 0);

vector<std::string> cfg_vnet_tables = {
CFG_VNET_TABLE_NAME,
Expand Down
4 changes: 2 additions & 2 deletions fpmsyncd/fpmsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ static bool eoiuFlagsSet(Table &bgpStateTable)
int main(int argc, char **argv)
{
swss::Logger::linkToDbNative("fpmsyncd");
DBConnector db(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector db("APPL_DB", 0);
RedisPipeline pipeline(&db);
RouteSync sync(&pipeline);

DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector stateDb("STATE_DB", 0);
Table bgpStateTable(&stateDb, STATE_BGP_TABLE_NAME);

NetDispatcher::getInstance().registerMessageHandler(RTM_NEWROUTE, &sync);
Expand Down
4 changes: 2 additions & 2 deletions neighsyncd/neighsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ int main(int argc, char **argv)
{
Logger::linkToDbNative("neighsyncd");

DBConnector appDb(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector appDb("APPL_DB", 0);
RedisPipeline pipelineAppDB(&appDb);
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector stateDb("STATE_DB", 0);

NeighSync sync(&pipelineAppDB, &stateDb);

Expand Down
2 changes: 1 addition & 1 deletion orchagent/aclorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ bool AclOrch::m_bCollectCounters = true;
sai_uint32_t AclRule::m_minPriority = 0;
sai_uint32_t AclRule::m_maxPriority = 0;

swss::DBConnector AclOrch::m_db(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
swss::DBConnector AclOrch::m_db("COUNTERS_DB", 0);
swss::Table AclOrch::m_countersTable(&m_db, "COUNTERS");

extern sai_acl_api_t* sai_acl_api;
Expand Down
4 changes: 2 additions & 2 deletions orchagent/bufferorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ type_map BufferOrch::m_buffer_type_maps = {

BufferOrch::BufferOrch(DBConnector *db, vector<string> &tableNames) :
Orch(db, tableNames),
m_flexCounterDb(new DBConnector(FLEX_COUNTER_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
m_flexCounterDb(new DBConnector("FLEX_COUNTER_DB", 0)),
m_flexCounterTable(new ProducerTable(m_flexCounterDb.get(), FLEX_COUNTER_TABLE)),
m_flexCounterGroupTable(new ProducerTable(m_flexCounterDb.get(), FLEX_COUNTER_GROUP_TABLE)),
m_countersDb(new DBConnector(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
m_countersDb(new DBConnector("COUNTERS_DB", 0)),
m_countersDbRedisClient(m_countersDb.get())
{
SWSS_LOG_ENTER();
Expand Down
2 changes: 1 addition & 1 deletion orchagent/countercheckorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CounterCheckOrch& CounterCheckOrch::getInstance(DBConnector *db)

CounterCheckOrch::CounterCheckOrch(DBConnector *db, vector<string> &tableNames):
Orch(db, tableNames),
m_countersDb(new DBConnector(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
m_countersDb(new DBConnector("COUNTERS_DB", 0)),
m_countersTable(new Table(m_countersDb.get(), COUNTERS_TABLE))
{
SWSS_LOG_ENTER();
Expand Down
2 changes: 1 addition & 1 deletion orchagent/crmorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const map<string, CrmResourceType> crmUsedCntsTableMap =

CrmOrch::CrmOrch(DBConnector *db, string tableName):
Orch(db, tableName),
m_countersDb(new DBConnector(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
m_countersDb(new DBConnector("COUNTERS_DB", 0)),
m_countersCrmTable(new Table(m_countersDb.get(), COUNTERS_CRM_TABLE)),
m_timer(new SelectableTimer(timespec { .tv_sec = CRM_POLLING_INTERVAL_DEFAULT, .tv_nsec = 0 }))
{
Expand Down
6 changes: 3 additions & 3 deletions orchagent/debugcounterorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ static const unordered_map<string, CounterType> flex_counter_type_lookup = {
DebugCounterOrch::DebugCounterOrch(DBConnector *db, const vector<string>& table_names, int poll_interval) :
Orch(db, table_names),
flex_counter_manager(DEBUG_COUNTER_FLEX_COUNTER_GROUP, StatsMode::READ, poll_interval),
m_stateDb(new DBConnector(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
m_stateDb(new DBConnector("STATE_DB", 0)),
m_debugCapabilitiesTable(new Table(m_stateDb.get(), STATE_DEBUG_COUNTER_CAPABILITIES_NAME)),
m_countersDb(new DBConnector(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
m_countersDb(new DBConnector("COUNTERS_DB", 0)),
m_counterNameToPortStatMap(new Table(m_countersDb.get(), COUNTERS_DEBUG_NAME_PORT_STAT_MAP)),
m_counterNameToSwitchStatMap(new Table(m_countersDb.get(), COUNTERS_DEBUG_NAME_SWITCH_STAT_MAP))
{
Expand Down Expand Up @@ -585,4 +585,4 @@ bool DebugCounterOrch::isDropReasonValid(const string& drop_reason) const
}

return true;
}
}
2 changes: 1 addition & 1 deletion orchagent/fdborch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ FdbOrch::FdbOrch(TableConnector applDbConnector, TableConnector stateDbConnector
Orch::addExecutor(flushNotifier);

/* Add FDB notifications support from ASIC */
DBConnector *notificationsDb = new DBConnector(ASIC_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector *notificationsDb = new DBConnector("ASIC_DB", 0);
m_fdbNotificationConsumer = new swss::NotificationConsumer(notificationsDb, "NOTIFICATIONS");
auto fdbNotifier = new Notifier(m_fdbNotificationConsumer, this, "FDB_NOTIFICATIONS");
Orch::addExecutor(fdbNotifier);
Expand Down
4 changes: 2 additions & 2 deletions orchagent/flex_counter/flex_counter_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ FlexCounterManager::FlexCounterManager(
stats_mode(stats_mode),
polling_interval(polling_interval),
enabled(false),
flex_counter_db(new DBConnector(FLEX_COUNTER_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
flex_counter_db(new DBConnector("FLEX_COUNTER_DB", 0)),
flex_counter_group_table(new ProducerTable(flex_counter_db.get(), FLEX_COUNTER_GROUP_TABLE)),
flex_counter_table(new ProducerTable(flex_counter_db.get(), FLEX_COUNTER_TABLE))
{
Expand Down Expand Up @@ -222,4 +222,4 @@ string FlexCounterManager::serializeCounterStats(
}

return stats_string;
}
}
2 changes: 1 addition & 1 deletion orchagent/flexcounterorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ unordered_map<string, string> flexCounterGroupMap =

FlexCounterOrch::FlexCounterOrch(DBConnector *db, vector<string> &tableNames):
Orch(db, tableNames),
m_flexCounterDb(new DBConnector(FLEX_COUNTER_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
m_flexCounterDb(new DBConnector("FLEX_COUNTER_DB", 0)),
m_flexCounterGroupTable(new ProducerTable(m_flexCounterDb.get(), FLEX_COUNTER_GROUP_TABLE))
{
SWSS_LOG_ENTER();
Expand Down
6 changes: 3 additions & 3 deletions orchagent/intfsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ IntfsOrch::IntfsOrch(DBConnector *db, string tableName, VRFOrch *vrf_orch) :
SWSS_LOG_ENTER();

/* Initialize DB connectors */
m_counter_db = shared_ptr<DBConnector>(new DBConnector(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0));
m_flex_db = shared_ptr<DBConnector>(new DBConnector(FLEX_COUNTER_DB, DBConnector::DEFAULT_UNIXSOCKET, 0));
m_asic_db = shared_ptr<DBConnector>(new DBConnector(ASIC_DB, DBConnector::DEFAULT_UNIXSOCKET, 0));
m_counter_db = shared_ptr<DBConnector>(new DBConnector("COUNTERS_DB", 0));
m_flex_db = shared_ptr<DBConnector>(new DBConnector("FLEX_COUNTER_DB", 0));
m_asic_db = shared_ptr<DBConnector>(new DBConnector("ASIC_DB", 0));
/* Initialize COUNTER_DB tables */
m_rifNameTable = unique_ptr<Table>(new Table(m_counter_db.get(), COUNTERS_RIF_NAME_MAP));
m_rifTypeTable = unique_ptr<Table>(new Table(m_counter_db.get(), COUNTERS_RIF_TYPE_MAP));
Expand Down
6 changes: 3 additions & 3 deletions orchagent/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ int main(int argc, char **argv)
SWSS_LOG_NOTICE("Created underlay router interface ID %" PRIx64, gUnderlayIfId);

/* Initialize orchestration components */
DBConnector appl_db(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector config_db(CONFIG_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector state_db(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector appl_db("APPL_DB", 0);
DBConnector config_db("CONFIG_DB", 0);
DBConnector state_db("STATE_DB", 0);

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

Expand Down
2 changes: 1 addition & 1 deletion orchagent/orchagent_restart_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int main(int argc, char **argv)
}
}

swss::DBConnector db(APPL_DB, swss::DBConnector::DEFAULT_UNIXSOCKET, 0);
swss::DBConnector db("APPL_DB", 0);
// Send warm restart query via "RESTARTCHECK" notification channel
swss::NotificationProducer restartQuery(&db, "RESTARTCHECK");
// Will listen for the reply on "RESTARTCHECKREPLY" channel
Expand Down
6 changes: 3 additions & 3 deletions orchagent/pfcwdorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extern PortsOrch *gPortsOrch;
template <typename DropHandler, typename ForwardHandler>
PfcWdOrch<DropHandler, ForwardHandler>::PfcWdOrch(DBConnector *db, vector<string> &tableNames):
Orch(db, tableNames),
m_countersDb(new DBConnector(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
m_countersDb(new DBConnector("COUNTERS_DB", 0)),
m_countersTable(new Table(m_countersDb.get(), COUNTERS_TABLE))
{
SWSS_LOG_ENTER();
Expand Down Expand Up @@ -652,14 +652,14 @@ PfcWdSwOrch<DropHandler, ForwardHandler>::PfcWdSwOrch(
const vector<sai_queue_attr_t> &queueAttrIds,
int pollInterval):
PfcWdOrch<DropHandler, ForwardHandler>(db, tableNames),
m_flexCounterDb(new DBConnector(FLEX_COUNTER_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
m_flexCounterDb(new DBConnector("FLEX_COUNTER_DB", 0)),
m_flexCounterTable(new ProducerTable(m_flexCounterDb.get(), FLEX_COUNTER_TABLE)),
m_flexCounterGroupTable(new ProducerTable(m_flexCounterDb.get(), FLEX_COUNTER_GROUP_TABLE)),
c_portStatIds(portStatIds),
c_queueStatIds(queueStatIds),
c_queueAttrIds(queueAttrIds),
m_pollInterval(pollInterval),
m_applDb(make_shared<DBConnector>(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)),
m_applDb(make_shared<DBConnector>("APPL_DB", 0)),
m_applTable(make_shared<Table>(m_applDb.get(), APP_PFC_WD_TABLE_NAME "_INSTORM")),
m_applDbRedisClient(m_applDb.get())
{
Expand Down
6 changes: 3 additions & 3 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ PortsOrch::PortsOrch(DBConnector *db, vector<table_name_with_pri_t> &tableNames)
SWSS_LOG_ENTER();

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

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

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

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

/* Add port oper status notification support */
DBConnector *notificationsDb = new DBConnector(ASIC_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector *notificationsDb = new DBConnector("ASIC_DB", 0);
m_portStatusNotificationConsumer = new swss::NotificationConsumer(notificationsDb, "NOTIFICATIONS");
auto portStatusNotificatier = new Notifier(m_portStatusNotificationConsumer, this, "PORT_STATUS_NOTIFICATIONS");
Orch::addExecutor(portStatusNotificatier);
Expand Down
2 changes: 1 addition & 1 deletion orchagent/routeresync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int main(int argc, char **argv)

SWSS_LOG_ENTER();

DBConnector db(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector db("APPL_DB", 0);
ProducerStateTable r(&db, APP_ROUTE_TABLE_NAME);

if (argc != 2)
Expand Down
4 changes: 2 additions & 2 deletions orchagent/watermarkorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ WatermarkOrch::WatermarkOrch(DBConnector *db, const vector<string> &tables):
{
SWSS_LOG_ENTER();

m_countersDb = make_shared<DBConnector>(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
m_appDb = make_shared<DBConnector>(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
m_countersDb = make_shared<DBConnector>("COUNTERS_DB", 0);
m_appDb = make_shared<DBConnector>("APPL_DB", 0);
m_countersTable = make_shared<Table>(m_countersDb.get(), COUNTERS_TABLE);
m_periodicWatermarkTable = make_shared<Table>(m_countersDb.get(), PERIODIC_WATERMARKS_TABLE);
m_persistentWatermarkTable = make_shared<Table>(m_countersDb.get(), PERSISTENT_WATERMARKS_TABLE);
Expand Down
6 changes: 3 additions & 3 deletions portsyncd/portsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ 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);
DBConnector cfgDb("CONFIG_DB", 0);
DBConnector appl_db("APPL_DB", 0);
DBConnector state_db("STATE_DB", 0);
ProducerStateTable p(&appl_db, APP_PORT_TABLE_NAME);
SubscriberStateTable portCfg(&cfgDb, CFG_PORT_TABLE_NAME);

Expand Down
4 changes: 1 addition & 3 deletions swssconfig/swssconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ using namespace std;
using namespace swss;
using json = nlohmann::json;

int db_port = 6379;
const char* const hostname = "localhost";
const char* const op_name = "OP";
const char* const name_delimiter = ":";
const int el_count = 2;
Expand All @@ -43,7 +41,7 @@ void dump_db_item(KeyOpFieldsValuesTuple &db_item)

bool write_db_data(vector<KeyOpFieldsValuesTuple> &db_items)
{
DBConnector db(APPL_DB, hostname, db_port, 0);
DBConnector db("APPL_DB", 0, true);
for (auto &db_item : db_items)
{
dump_db_item(db_item);
Expand Down
5 changes: 1 addition & 4 deletions swssconfig/swssplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
using namespace std;
using namespace swss;

constexpr int DB_PORT = 6379;
constexpr char* DB_HOSTNAME = "localhost";

static int line_index = 0;
static DBConnector db(APPL_DB, DB_HOSTNAME, DB_PORT, 0);
static DBConnector db("APPL_DB", 0, true);

void usage()
{
Expand Down
4 changes: 2 additions & 2 deletions teamsyncd/teamsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ using namespace swss;
int main(int argc, char **argv)
{
swss::Logger::linkToDbNative(TEAMSYNCD_APP_NAME);
DBConnector db(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector stateDb(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
DBConnector db("APPL_DB", 0);
DBConnector stateDb("STATE_DB", 0);
Select s;
TeamSync sync(&db, &stateDb, &s);

Expand Down
Loading

0 comments on commit 2412ef9

Please sign in to comment.