Skip to content

Commit

Permalink
Remove some TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
JackyWoo committed Feb 20, 2024
1 parent 86edd35 commit 3badd6b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Service/NuRaftLogSnapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,11 +620,9 @@ bool KeeperSnapshotStore::parseBatchBody(KeeperStore & store, char * batch_buf,
LOG_TRACE(log, "Load snapshot read key {}, node stat {}", key, node->stat.toString());
store.container.emplace(key, std::move(node));

if (store.container.get(key)->is_ephemeral) // TODO
LOG_INFO(log, "{} is ephemeral and owner is {}", key, ephemeral_owner);
if (ephemeral_owner != 0)
{
LOG_TRACE(log, "Load snapshot find ephemeral node {} - {}", ephemeral_owner, key);
LOG_TRACE(log, "Load snapshot find ephemeral node {} owner {}", key, ephemeral_owner);
std::lock_guard l(store.ephemerals_mutex);
auto & ephemeral_nodes = store.ephemerals[ephemeral_owner];
ephemeral_nodes.emplace(key);
Expand Down Expand Up @@ -940,8 +938,8 @@ bool KeeperSnapshotStore::parseBatchBodyV2(KeeperStore & store, char * batch_buf

void KeeperSnapshotStore::loadLatestSnapshot(KeeperStore & store)
{
ThreadPool object_thread_pool(1);/// TODO SNAPSHOT_THREAD_NUM
for (UInt32 thread_idx = 0; thread_idx < 1; thread_idx++) // TODO
ThreadPool object_thread_pool(SNAPSHOT_THREAD_NUM);
for (UInt32 thread_idx = 0; thread_idx < SNAPSHOT_THREAD_NUM; thread_idx++)
{
object_thread_pool.trySchedule(
[this, thread_idx, &store]
Expand All @@ -950,7 +948,7 @@ void KeeperSnapshotStore::loadLatestSnapshot(KeeperStore & store)
UInt32 obj_idx = 0;
for (auto it = this->objects_path.begin(); it != this->objects_path.end(); it++)
{
if (obj_idx % 1 == thread_idx) // TODO
if (obj_idx % SNAPSHOT_THREAD_NUM == thread_idx)
{
LOG_INFO(
thread_log,
Expand Down

0 comments on commit 3badd6b

Please sign in to comment.