Skip to content

Commit

Permalink
Removing unchecked.for_each_par as it's effectively unused.
Browse files Browse the repository at this point in the history
This disables migrating of unchecked table from lmdb to rocksdb, however, this upgrade really isn't needed.
  • Loading branch information
clemahieu committed Jun 8, 2022
1 parent fef94e3 commit 57c2210
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 21 deletions.
9 changes: 0 additions & 9 deletions nano/secure/ledger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1438,15 +1438,6 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (boost::filesystem::path const & data
}
});

store.unchecked.for_each_par (
[&rocksdb_store] (nano::read_transaction const & /*unused*/, auto i, auto n) {
for (; i != n; ++i)
{
auto rocksdb_transaction (rocksdb_store->tx_begin_write ({}, { nano::tables::unchecked }));
rocksdb_store->unchecked.put (rocksdb_transaction, i->first, i->second);
}
});

store.pending.for_each_par (
[&rocksdb_store] (nano::read_transaction const & /*unused*/, auto i, auto n) {
for (; i != n; ++i)
Expand Down
1 change: 0 additions & 1 deletion nano/secure/store.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,6 @@ class unchecked_store
virtual nano::store_iterator<nano::unchecked_key, nano::unchecked_info> begin (nano::transaction const &, nano::unchecked_key const &) const = 0;
virtual nano::store_iterator<nano::unchecked_key, nano::unchecked_info> end () const = 0;
virtual size_t count (nano::transaction const &) = 0;
virtual void for_each_par (std::function<void (nano::read_transaction const &, nano::store_iterator<nano::unchecked_key, nano::unchecked_info>, nano::store_iterator<nano::unchecked_key, nano::unchecked_info>)> const & action_a) const = 0;
};

/**
Expand Down
11 changes: 0 additions & 11 deletions nano/secure/store/unchecked_store_partial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,6 @@ class unchecked_store_partial : public unchecked_store
{
return store.count (transaction_a, tables::unchecked);
}

void for_each_par (std::function<void (nano::read_transaction const &, nano::store_iterator<nano::unchecked_key, nano::unchecked_info>, nano::store_iterator<nano::unchecked_key, nano::unchecked_info>)> const & action_a) const override
{
parallel_traversal<nano::uint512_t> (
[&action_a, this] (nano::uint512_t const & start, nano::uint512_t const & end, bool const is_last) {
nano::unchecked_key key_start (start);
nano::unchecked_key key_end (end);
auto transaction (this->store.tx_begin_read ());
action_a (transaction, this->begin (transaction, key_start), !is_last ? this->begin (transaction, key_end) : this->end ());
});
}
};

}

0 comments on commit 57c2210

Please # to comment.