From 3e686c7cbee8d500f33293149bbb87de169cb3e0 Mon Sep 17 00:00:00 2001 From: sdong Date: Thu, 27 Oct 2022 11:56:09 -0700 Subject: [PATCH] sst_dump --command=raw to add index offset information (#10873) Summary: Add some extra information in outputs of "sst_dump --command=raw" to help debug some issues. Right now, encoded block handle is printed out. It is more useful to directly print out offset and size. Pull Request resolved: https://github.com/facebook/rocksdb/pull/10873 Test Plan: Manually run it against a file and check the output. Reviewed By: anand1976 Differential Revision: D40742289 fbshipit-source-id: 04d7de26e7f27e1595a7cc3ac1c1082e4e835b93 --- table/block_based/block_based_table_reader.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/table/block_based/block_based_table_reader.cc b/table/block_based/block_based_table_reader.cc index fa191ccfb..5ea98634d 100644 --- a/table/block_based/block_based_table_reader.cc +++ b/table/block_based/block_based_table_reader.cc @@ -2981,7 +2981,8 @@ Status BlockBasedTable::DumpIndexBlock(std::ostream& out_stream) { out_stream << " HEX " << user_key.ToString(true) << ": " << blockhandles_iter->value().ToString(true, rep_->index_has_first_key) - << "\n"; + << " offset " << blockhandles_iter->value().handle.offset() + << " size " << blockhandles_iter->value().handle.size() << "\n"; std::string str_key = user_key.ToString(); std::string res_key("");