@@ -364,9 +364,8 @@ void PfcWdSwOrch<DropHandler, ForwardHandler>::disableBigRedSwitchMode()
364
364
}
365
365
366
366
auto queueId = entry.first ;
367
- RedisClient redisClient (this ->getCountersDb ().get ());
368
367
string countersKey = this ->getCountersTable ()->getTableName () + this ->getCountersTable ()->getTableNameSeparator () + sai_serialize_object_id (queueId);
369
- redisClient. hdel (countersKey, " BIG_RED_SWITCH_MODE" );
368
+ this -> getCountersDb ()-> hdel (countersKey, " BIG_RED_SWITCH_MODE" );
370
369
}
371
370
372
371
m_brsEntryMap.clear ();
@@ -633,9 +632,8 @@ void PfcWdSwOrch<DropHandler, ForwardHandler>::unregisterFromWdDb(const Port& po
633
632
m_entryMap.erase (queueId);
634
633
635
634
// Clean up
636
- RedisClient redisClient (this ->getCountersDb ().get ());
637
635
string countersKey = this ->getCountersTable ()->getTableName () + this ->getCountersTable ()->getTableNameSeparator () + sai_serialize_object_id (queueId);
638
- redisClient. hdel (countersKey, {" PFC_WD_DETECTION_TIME" , " PFC_WD_RESTORATION_TIME" , " PFC_WD_ACTION" , " PFC_WD_STATUS" });
636
+ this -> getCountersDb ()-> hdel (countersKey, {" PFC_WD_DETECTION_TIME" , " PFC_WD_RESTORATION_TIME" , " PFC_WD_ACTION" , " PFC_WD_STATUS" });
639
637
}
640
638
641
639
}
@@ -657,8 +655,7 @@ PfcWdSwOrch<DropHandler, ForwardHandler>::PfcWdSwOrch(
657
655
c_queueAttrIds(queueAttrIds),
658
656
m_pollInterval(pollInterval),
659
657
m_applDb(make_shared<DBConnector>(" APPL_DB" , 0 )),
660
- m_applTable(make_shared<Table>(m_applDb.get(), APP_PFC_WD_TABLE_NAME "_INSTORM")),
661
- m_applDbRedisClient(m_applDb.get())
658
+ m_applTable(make_shared<Table>(m_applDb.get(), APP_PFC_WD_TABLE_NAME "_INSTORM"))
662
659
{
663
660
SWSS_LOG_ENTER ();
664
661
@@ -934,7 +931,7 @@ bool PfcWdSwOrch<DropHandler, ForwardHandler>::startWdActionOnQueue(const string
934
931
entry->second .handler ->initCounters ();
935
932
// Log storm event to APPL_DB for warm-reboot purpose
936
933
string key = m_applTable->getTableName () + m_applTable->getTableNameSeparator () + entry->second .portAlias ;
937
- m_applDbRedisClient. hset (key, to_string (entry->second .index ), PFC_WD_IN_STORM);
934
+ m_applDb-> hset (key, to_string (entry->second .index ), PFC_WD_IN_STORM);
938
935
}
939
936
}
940
937
else if (entry->second .action == PfcWdAction::PFC_WD_ACTION_DROP)
@@ -956,7 +953,7 @@ bool PfcWdSwOrch<DropHandler, ForwardHandler>::startWdActionOnQueue(const string
956
953
entry->second .handler ->initCounters ();
957
954
// Log storm event to APPL_DB for warm-reboot purpose
958
955
string key = m_applTable->getTableName () + m_applTable->getTableNameSeparator () + entry->second .portAlias ;
959
- m_applDbRedisClient. hset (key, to_string (entry->second .index ), PFC_WD_IN_STORM);
956
+ m_applDb-> hset (key, to_string (entry->second .index ), PFC_WD_IN_STORM);
960
957
}
961
958
}
962
959
else if (entry->second .action == PfcWdAction::PFC_WD_ACTION_FORWARD)
@@ -978,7 +975,7 @@ bool PfcWdSwOrch<DropHandler, ForwardHandler>::startWdActionOnQueue(const string
978
975
entry->second .handler ->initCounters ();
979
976
// Log storm event to APPL_DB for warm-reboot purpose
980
977
string key = m_applTable->getTableName () + m_applTable->getTableNameSeparator () + entry->second .portAlias ;
981
- m_applDbRedisClient. hset (key, to_string (entry->second .index ), PFC_WD_IN_STORM);
978
+ m_applDb-> hset (key, to_string (entry->second .index ), PFC_WD_IN_STORM);
982
979
}
983
980
}
984
981
else
@@ -1002,7 +999,7 @@ bool PfcWdSwOrch<DropHandler, ForwardHandler>::startWdActionOnQueue(const string
1002
999
entry->second .handler = nullptr ;
1003
1000
// Remove storm status in APPL_DB for warm-reboot purpose
1004
1001
string key = m_applTable->getTableName () + m_applTable->getTableNameSeparator () + entry->second .portAlias ;
1005
- m_applDbRedisClient. hdel (key, to_string (entry->second .index ));
1002
+ m_applDb-> hdel (key, to_string (entry->second .index ));
1006
1003
}
1007
1004
}
1008
1005
else
@@ -1019,8 +1016,6 @@ bool PfcWdSwOrch<DropHandler, ForwardHandler>::bake()
1019
1016
{
1020
1017
// clean all *_last and *_LEFT fields in COUNTERS_TABLE
1021
1018
// to allow warm-reboot pfc detect & restore state machine to enter the same init state as cold-reboot
1022
- RedisClient redisClient (this ->getCountersDb ().get ());
1023
-
1024
1019
vector<string> cKeys;
1025
1020
this ->getCountersTable ()->getKeys (cKeys);
1026
1021
for (const auto &key : cKeys)
@@ -1037,7 +1032,7 @@ bool PfcWdSwOrch<DropHandler, ForwardHandler>::bake()
1037
1032
}
1038
1033
if (!wLasts.empty ())
1039
1034
{
1040
- redisClient. hdel (
1035
+ this -> getCountersDb ()-> hdel (
1041
1036
this ->getCountersTable ()->getTableName ()
1042
1037
+ this ->getCountersTable ()->getTableNameSeparator ()
1043
1038
+ key,
0 commit comments