From 0e3cc2cf1f3aafe783432e631633140053861bdc Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Fri, 8 Apr 2016 18:50:18 -0700 Subject: [PATCH] Add column family info to TableProperties::ToString() Summary: This is used at least by `sst_dump --show_properties` Test Plan: - default CF ``` $ ./sst_dump --show_properties --file=./tmp-db/000007.sst | grep 'column family' column family ID: 0 column family name: default ``` - custom CF ``` $ ./sst_dump --show_properties --file=./tmp-db/000012.sst | grep 'column family' column family ID: 1 column family name: col-fam-1 ``` - no CF ``` $ ./sst_dump --show_properties --file=./tmp-db/000017.sst | grep 'column family' column family ID: N/A column family name: N/A ``` Reviewers: IslamAbdelRahman Reviewed By: IslamAbdelRahman Subscribers: andrewkr, dhruba, leveldb Differential Revision: https://reviews.facebook.net/D56499 --- table/table_properties.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/table/table_properties.cc b/table/table_properties.cc index 3a41529ff..ed71a333c 100644 --- a/table/table_properties.cc +++ b/table/table_properties.cc @@ -75,6 +75,17 @@ std::string TableProperties::ToString( filter_policy_name.empty() ? std::string("N/A") : filter_policy_name, prop_delim, kv_delim); + AppendProperty(result, "column family ID", + column_family_id == rocksdb::TablePropertiesCollectorFactory:: + Context::kUnknownColumnFamily + ? std::string("N/A") + : rocksdb::ToString(column_family_id), + prop_delim, kv_delim); + AppendProperty( + result, "column family name", + column_family_name.empty() ? std::string("N/A") : column_family_name, + prop_delim, kv_delim); + return result; }