Skip to content

Commit 7ae5883

Browse files
authored
Replace RedisClient with DBConnector (sonic-net#660)
After this PR: sonic-net/sonic-swss-common#382
1 parent a5f9bfb commit 7ae5883

File tree

3 files changed

+1
-7
lines changed

3 files changed

+1
-7
lines changed

lib/inc/RedisVidIndexGenerator.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,5 @@ namespace sairedis
3232
std::shared_ptr<swss::DBConnector> m_dbConnector;
3333

3434
std::string m_vidCounterName;
35-
36-
std::shared_ptr<swss::RedisClient> m_redisClient;
3735
};
3836
}

lib/src/RedisVidIndexGenerator.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ RedisVidIndexGenerator::RedisVidIndexGenerator(
1111
m_vidCounterName(vidCounterName)
1212
{
1313
SWSS_LOG_ENTER();
14-
15-
m_redisClient = std::make_shared<swss::RedisClient>(m_dbConnector.get());
1614
}
1715

1816
uint64_t RedisVidIndexGenerator::increment()
@@ -22,7 +20,7 @@ uint64_t RedisVidIndexGenerator::increment()
2220
// this counter must be atomic since it can be independently accessed by
2321
// sairedis and syncd
2422

25-
return m_redisClient->incr(m_vidCounterName); // "VIDCOUNTER"
23+
return m_dbConnector->incr(m_vidCounterName); // "VIDCOUNTER"
2624
}
2725

2826
void RedisVidIndexGenerator::reset()

syncd/tests.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ sai_status_t sai_bulk_remove_fdb_entry(
6060
SWSS_LOG_THROW(format ": %s", ##__VA_ARGS__, sai_serialize_status(status).c_str());
6161

6262
using namespace saimeta;
63-
static std::shared_ptr<swss::RedisClient> g_redisClient;
6463
static std::shared_ptr<swss::DBConnector> g_db1;
6564

6665
static sai_next_hop_group_api_t test_next_hop_group_api;
@@ -89,7 +88,6 @@ void clearDB()
8988

9089
g_db1 = std::make_shared<swss::DBConnector>("ASIC_DB", 0, true);
9190
swss::RedisReply r(g_db1.get(), "FLUSHALL", REDIS_REPLY_STATUS);
92-
g_redisClient = std::make_shared<swss::RedisClient>(g_db1.get());
9391

9492
r.checkStatusOK();
9593
}

0 commit comments

Comments
 (0)