From 7a53afc4c8fce98d65dab0f542ef973bf9521151 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 9 Jun 2020 20:37:30 -0700 Subject: [PATCH] ircd::db: Add delta encoding indicator to SST info; add to console cmd output. --- include/ircd/db/sst.h | 1 + ircd/db.cc | 1 + modules/console.cc | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/ircd/db/sst.h b/include/ircd/db/sst.h index a2cfb6be9..b2596fb2d 100644 --- a/include/ircd/db/sst.h +++ b/include/ircd/db/sst.h @@ -57,6 +57,7 @@ struct ircd::db::database::sst::info int32_t version {-1}; time_t created {0}; time_t oldest_key {0}; + bool delta_encoding {false}; info(const database &, const string_view &filename); info() = default; diff --git a/ircd/db.cc b/ircd/db.cc index 53a6bc339..41760af2e 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -3796,6 +3796,7 @@ ircd::db::database::sst::info::operator=(rocksdb::TableProperties &&tp) fixed_key_len = std::move(tp.fixed_key_len); created = std::move(tp.creation_time); oldest_key = std::move(tp.oldest_key_time); + delta_encoding = std::move(tp.index_value_is_delta_encoded); return *this; } diff --git a/modules/console.cc b/modules/console.cc index 5df3a8fee..407fcdd8f 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -4022,7 +4022,9 @@ _print_sst_info(opt &out, << std::setw(12) << f.name << " " << std::setw(32) << std::left << (f.created? timef(tmbuf, f.created, ircd::localtime) : string_view{}) << " " << std::setw(5) << std::right << trunc(f.compression, 5) - << " " << std::setw(3) << std::left << (!f.filter.empty()? 'F' : ' ') + << " " << std::setw(1) << std::left << (!f.filter.empty()? 'F' : ' ') + << std::setw(1) << std::left << (f.delta_encoding? 'D' : ' ') + << std::setw(1) << std::left << (true? ' ' : ' ') << " " << std::setw(24) << std::left << pretty(pbuf, iec(f.size)) << " " << std::setw(10) << std::right << f.min_seq << " : " << std::setw(10) << std::left << f.max_seq << " " << std::setw(10) << std::right << min_key << " : " << std::setw(10) << std::left << max_key @@ -4099,6 +4101,7 @@ _print_sst_info_full(opt &out, close_auto("range deletes", f.range_deletes); close_auto("compacting", f.compacting? "yes"_sv : "no"_sv); close_auto("compression", f.compression); + close_auto("delta encode", f.delta_encoding? "yes"_sv : "no"_sv); close_auto("", ""); const auto blocks_size{f.keys_size + f.values_size};