Skip to content

Commit

Permalink
Added linebreaks
Browse files Browse the repository at this point in the history
  • Loading branch information
RickiNano committed Jun 14, 2024
1 parent 5279d2b commit ce5a2f3
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions nano/secure/ledger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p

if (!rocksdb_store->init_error ())
{
std::cout << "Step 1 of 7: Converting blocks table..." << std::endl;
std::cout << "Step 1 of 7: Converting blocks table... " << std::endl;
std::size_t count = 0;
store.block.for_each_par (
[&rocksdb_store, &count] (store::read_transaction const & /*unused*/, auto i, auto n) {
Expand All @@ -1258,104 +1258,104 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p
}
rocksdb_store->block.raw_put (rocksdb_transaction, vector, i->first);

if (count % 250000 == 0 && count != 0)
if (count % 200000 == 0 && count != 0)
{
std::cout << "." << std::flush;
}
}
});

std::cout << "Step 2 of 7: Converting pending table..." << std::endl;
std::cout << "\nStep 2 of 7: Converting pending table..." << std::endl;
count = 0;
store.pending.for_each_par (
[&rocksdb_store, &count] (store::read_transaction const & /*unused*/, auto i, auto n) {
for (; i != n; ++i, ++count)
{
auto rocksdb_transaction (rocksdb_store->tx_begin_write ({}, { nano::tables::pending }));
rocksdb_store->pending.put (rocksdb_transaction, i->first, i->second);
if (count % 250000 == 0 && count != 0)
if (count % 50000 == 0 && count != 0)
{
std::cout << "." << std::flush;
}
}
});

std::cout << "Step 3 of 7: Converting confirmation_height table..." << std::endl;
std::cout << "\nStep 3 of 7: Converting confirmation_height table..." << std::endl;
count = 0;
store.confirmation_height.for_each_par (
[&rocksdb_store, &count] (store::read_transaction const & /*unused*/, auto i, auto n) {
for (; i != n; ++i, ++count)
{
auto rocksdb_transaction (rocksdb_store->tx_begin_write ({}, { nano::tables::confirmation_height }));
rocksdb_store->confirmation_height.put (rocksdb_transaction, i->first, i->second);
if (count % 250000 == 0 && count != 0)
if (count % 50000 == 0 && count != 0)
{
std::cout << "." << std::flush;
}
}
});

std::cout << "Step 4 of 7: Converting accounts height table..." << std::endl;
std::cout << "\nStep 4 of 7: Converting accounts height table..." << std::endl;
count = 0;
store.account.for_each_par (
[&rocksdb_store, &count] (store::read_transaction const & /*unused*/, auto i, auto n) {
for (; i != n; ++i, ++count)
{
auto rocksdb_transaction (rocksdb_store->tx_begin_write ({}, { nano::tables::accounts }));
rocksdb_store->account.put (rocksdb_transaction, i->first, i->second);
if (count % 250000 == 0 && count != 0)
if (count % 50000 == 0 && count != 0)
{
std::cout << "." << std::flush;
}
}
});

std::cout << "Step 5 of 7: Converting rep_weights table..." << std::endl;
std::cout << "\nStep 5 of 7: Converting rep_weights table..." << std::endl;
count = 0;
store.rep_weight.for_each_par (
[&rocksdb_store, &count] (store::read_transaction const & /*unused*/, auto i, auto n) {
for (; i != n; ++i, ++count)
{
auto rocksdb_transaction (rocksdb_store->tx_begin_write ({}, { nano::tables::rep_weights }));
rocksdb_store->rep_weight.put (rocksdb_transaction, i->first, i->second.number ());
if (count % 250000 == 0 && count != 0)
if (count % 50000 == 0 && count != 0)
{
std::cout << "." << std::flush;
}
}
});

std::cout << "Step 6 of 7: Converting pruned table..." << std::endl;
std::cout << "\nStep 6 of 7: Converting pruned table..." << std::endl;
count = 0;
store.pruned.for_each_par (
[&rocksdb_store, &count] (store::read_transaction const & /*unused*/, auto i, auto n) {
for (; i != n; ++i, ++count)
{
auto rocksdb_transaction (rocksdb_store->tx_begin_write ({}, { nano::tables::pruned }));
rocksdb_store->pruned.put (rocksdb_transaction, i->first);
if (count % 250000 == 0 && count != 0)
if (count % 100000 == 0 && count != 0)
{
std::cout << "." << std::flush;
}
}
});

std::cout << "Step 7 of 7: Converting final_votes table..." << std::endl;
std::cout << "\nStep 7 of 7: Converting final_votes table..." << std::endl;
count = 0;
store.final_vote.for_each_par (
[&rocksdb_store, &count] (store::read_transaction const & /*unused*/, auto i, auto n) {
for (; i != n; ++i, ++count)
{
auto rocksdb_transaction (rocksdb_store->tx_begin_write ({}, { nano::tables::final_votes }));
rocksdb_store->final_vote.put (rocksdb_transaction, i->first, i->second);
if (count % 250000 == 0 && count != 0)
if (count % 100000 == 0 && count != 0)
{
std::cout << "." << std::flush;
}
}
});

std::cout << "Finalizing migration..." << std::endl;
std::cout << "\nFinalizing migration..." << std::endl;
auto lmdb_transaction (store.tx_begin_read ());
auto version = store.version.get (lmdb_transaction);
auto rocksdb_transaction (rocksdb_store->tx_begin_write ());
Expand Down

0 comments on commit ce5a2f3

Please sign in to comment.