fork of https://github.com/oxigraph/rocksdb and https://github.com/facebook/rocksdb for nextgraph and oxigraph
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
511 lines
17 KiB
511 lines
17 KiB
10 years ago
|
// Copyright (c) 2013, Facebook, Inc. All rights reserved.
|
||
|
// This source code is licensed under the BSD-style license found in the
|
||
|
// LICENSE file in the root directory of this source tree. An additional grant
|
||
|
// of patent rights can be found in the PATENTS file in the same directory.
|
||
|
//
|
||
10 years ago
|
#ifndef ROCKSDB_LITE
|
||
10 years ago
|
|
||
9 years ago
|
#include "tools/sst_dump_tool_imp.h"
|
||
10 years ago
|
|
||
10 years ago
|
#ifndef __STDC_FORMAT_MACROS
|
||
|
#define __STDC_FORMAT_MACROS
|
||
|
#endif
|
||
|
|
||
10 years ago
|
#include <inttypes.h>
|
||
9 years ago
|
#include "port/port.h"
|
||
10 years ago
|
|
||
|
namespace rocksdb {
|
||
|
|
||
10 years ago
|
using std::dynamic_pointer_cast;
|
||
|
|
||
10 years ago
|
SstFileReader::SstFileReader(const std::string& file_path,
|
||
|
bool verify_checksum,
|
||
|
bool output_hex)
|
||
|
:file_name_(file_path), read_num_(0), verify_checksum_(verify_checksum),
|
||
|
output_hex_(output_hex), ioptions_(options_),
|
||
|
internal_comparator_(BytewiseComparator()) {
|
||
|
fprintf(stdout, "Process %s\n", file_path.c_str());
|
||
10 years ago
|
init_result_ = GetTableReader(file_name_);
|
||
10 years ago
|
}
|
||
|
|
||
10 years ago
|
extern const uint64_t kBlockBasedTableMagicNumber;
|
||
|
extern const uint64_t kLegacyBlockBasedTableMagicNumber;
|
||
|
extern const uint64_t kPlainTableMagicNumber;
|
||
|
extern const uint64_t kLegacyPlainTableMagicNumber;
|
||
10 years ago
|
|
||
10 years ago
|
const char* testFileName = "test_file_name";
|
||
|
|
||
10 years ago
|
Status SstFileReader::GetTableReader(const std::string& file_path) {
|
||
10 years ago
|
uint64_t magic_number;
|
||
|
|
||
|
// read table magic number
|
||
|
Footer footer;
|
||
|
|
||
|
unique_ptr<RandomAccessFile> file;
|
||
|
uint64_t file_size;
|
||
10 years ago
|
Status s = options_.env->NewRandomAccessFile(file_path, &file, soptions_);
|
||
10 years ago
|
if (s.ok()) {
|
||
|
s = options_.env->GetFileSize(file_path, &file_size);
|
||
|
}
|
||
10 years ago
|
|
||
|
file_.reset(new RandomAccessFileReader(std::move(file)));
|
||
|
|
||
10 years ago
|
if (s.ok()) {
|
||
|
s = ReadFooterFromFile(file_.get(), file_size, &footer);
|
||
|
}
|
||
|
if (s.ok()) {
|
||
|
magic_number = footer.table_magic_number();
|
||
|
}
|
||
|
|
||
|
if (s.ok()) {
|
||
|
if (magic_number == kPlainTableMagicNumber ||
|
||
|
magic_number == kLegacyPlainTableMagicNumber) {
|
||
|
soptions_.use_mmap_reads = true;
|
||
10 years ago
|
options_.env->NewRandomAccessFile(file_path, &file, soptions_);
|
||
|
file_.reset(new RandomAccessFileReader(std::move(file)));
|
||
10 years ago
|
}
|
||
|
options_.comparator = &internal_comparator_;
|
||
|
// For old sst format, ReadTableProperties might fail but file can be read
|
||
|
if (ReadTableProperties(magic_number, file_.get(), file_size).ok()) {
|
||
|
SetTableOptionsByMagicNumber(magic_number);
|
||
|
} else {
|
||
|
SetOldTableOptions();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (s.ok()) {
|
||
10 years ago
|
s = NewTableReader(ioptions_, soptions_, internal_comparator_, file_size,
|
||
|
&table_reader_);
|
||
10 years ago
|
}
|
||
|
return s;
|
||
|
}
|
||
|
|
||
10 years ago
|
Status SstFileReader::NewTableReader(
|
||
|
const ImmutableCFOptions& ioptions, const EnvOptions& soptions,
|
||
10 years ago
|
const InternalKeyComparator& internal_comparator, uint64_t file_size,
|
||
10 years ago
|
unique_ptr<TableReader>* table_reader) {
|
||
|
// We need to turn off pre-fetching of index and filter nodes for
|
||
|
// BlockBasedTable
|
||
|
shared_ptr<BlockBasedTableFactory> block_table_factory =
|
||
|
dynamic_pointer_cast<BlockBasedTableFactory>(options_.table_factory);
|
||
|
|
||
|
if (block_table_factory) {
|
||
|
return block_table_factory->NewTableReader(
|
||
9 years ago
|
TableReaderOptions(ioptions_, soptions_, internal_comparator_),
|
||
|
std::move(file_), file_size, &table_reader_, /*enable_prefetch=*/false);
|
||
10 years ago
|
}
|
||
|
|
||
|
assert(!block_table_factory);
|
||
|
|
||
|
// For all other factory implementation
|
||
|
return options_.table_factory->NewTableReader(
|
||
9 years ago
|
TableReaderOptions(ioptions_, soptions_, internal_comparator_),
|
||
|
std::move(file_), file_size, &table_reader_);
|
||
10 years ago
|
}
|
||
|
|
||
10 years ago
|
Status SstFileReader::DumpTable(const std::string& out_filename) {
|
||
|
unique_ptr<WritableFile> out_file;
|
||
|
Env* env = Env::Default();
|
||
|
env->NewWritableFile(out_filename, &out_file, soptions_);
|
||
|
Status s = table_reader_->DumpTable(out_file.get());
|
||
|
out_file->Close();
|
||
|
return s;
|
||
|
}
|
||
|
|
||
10 years ago
|
uint64_t SstFileReader::CalculateCompressedTableSize(
|
||
|
const TableBuilderOptions& tb_options, size_t block_size) {
|
||
|
unique_ptr<WritableFile> out_file;
|
||
|
unique_ptr<Env> env(NewMemEnv(Env::Default()));
|
||
|
env->NewWritableFile(testFileName, &out_file, soptions_);
|
||
|
unique_ptr<WritableFileWriter> dest_writer;
|
||
|
dest_writer.reset(new WritableFileWriter(std::move(out_file), soptions_));
|
||
|
BlockBasedTableOptions table_options;
|
||
|
table_options.block_size = block_size;
|
||
|
BlockBasedTableFactory block_based_tf(table_options);
|
||
10 years ago
|
unique_ptr<TableBuilder> table_builder;
|
||
|
table_builder.reset(block_based_tf.NewTableBuilder(
|
||
9 years ago
|
tb_options,
|
||
|
TablePropertiesCollectorFactory::Context::kUnknownColumnFamily,
|
||
|
dest_writer.get()));
|
||
9 years ago
|
unique_ptr<InternalIterator> iter(table_reader_->NewIterator(ReadOptions()));
|
||
10 years ago
|
for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {
|
||
|
if (!iter->status().ok()) {
|
||
10 years ago
|
fputs(iter->status().ToString().c_str(), stderr);
|
||
10 years ago
|
exit(1);
|
||
|
}
|
||
10 years ago
|
table_builder->Add(iter->key(), iter->value());
|
||
10 years ago
|
}
|
||
10 years ago
|
Status s = table_builder->Finish();
|
||
10 years ago
|
if (!s.ok()) {
|
||
10 years ago
|
fputs(s.ToString().c_str(), stderr);
|
||
10 years ago
|
exit(1);
|
||
|
}
|
||
10 years ago
|
uint64_t size = table_builder->FileSize();
|
||
10 years ago
|
env->DeleteFile(testFileName);
|
||
|
return size;
|
||
|
}
|
||
|
|
||
|
int SstFileReader::ShowAllCompressionSizes(size_t block_size) {
|
||
|
ReadOptions read_options;
|
||
|
Options opts;
|
||
|
const ImmutableCFOptions imoptions(opts);
|
||
|
rocksdb::InternalKeyComparator ikc(opts.comparator);
|
||
|
std::vector<std::unique_ptr<IntTblPropCollectorFactory> >
|
||
|
block_based_table_factories;
|
||
|
|
||
|
std::map<CompressionType, const char*> compress_type;
|
||
|
compress_type.insert(
|
||
|
std::make_pair(CompressionType::kNoCompression, "kNoCompression"));
|
||
|
compress_type.insert(std::make_pair(CompressionType::kSnappyCompression,
|
||
|
"kSnappyCompression"));
|
||
|
compress_type.insert(
|
||
|
std::make_pair(CompressionType::kZlibCompression, "kZlibCompression"));
|
||
|
compress_type.insert(
|
||
|
std::make_pair(CompressionType::kBZip2Compression, "kBZip2Compression"));
|
||
|
compress_type.insert(
|
||
|
std::make_pair(CompressionType::kLZ4Compression, "kLZ4Compression"));
|
||
|
compress_type.insert(
|
||
|
std::make_pair(CompressionType::kLZ4HCCompression, "kLZ4HCCompression"));
|
||
9 years ago
|
compress_type.insert(std::make_pair(CompressionType::kZSTDNotFinalCompression,
|
||
|
"kZSTDNotFinalCompression"));
|
||
10 years ago
|
|
||
9 years ago
|
fprintf(stdout, "Block Size: %" ROCKSDB_PRIszt "\n", block_size);
|
||
10 years ago
|
|
||
|
for (CompressionType i = CompressionType::kNoCompression;
|
||
9 years ago
|
i <= CompressionType::kZSTDNotFinalCompression;
|
||
|
i = (i == kLZ4HCCompression) ? kZSTDNotFinalCompression
|
||
|
: CompressionType(i + 1)) {
|
||
10 years ago
|
CompressionOptions compress_opt;
|
||
10 years ago
|
TableBuilderOptions tb_opts(imoptions, ikc, &block_based_table_factories, i,
|
||
10 years ago
|
compress_opt, false);
|
||
10 years ago
|
uint64_t file_size = CalculateCompressedTableSize(tb_opts, block_size);
|
||
|
fprintf(stdout, "Compression: %s", compress_type.find(i)->second);
|
||
|
fprintf(stdout, " Size: %" PRIu64 "\n", file_size);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
10 years ago
|
Status SstFileReader::ReadTableProperties(uint64_t table_magic_number,
|
||
10 years ago
|
RandomAccessFileReader* file,
|
||
10 years ago
|
uint64_t file_size) {
|
||
|
TableProperties* table_properties = nullptr;
|
||
|
Status s = rocksdb::ReadTableProperties(file, file_size, table_magic_number,
|
||
|
options_.env, options_.info_log.get(),
|
||
|
&table_properties);
|
||
|
if (s.ok()) {
|
||
|
table_properties_.reset(table_properties);
|
||
|
} else {
|
||
|
fprintf(stdout, "Not able to read table properties\n");
|
||
|
}
|
||
|
return s;
|
||
|
}
|
||
|
|
||
|
Status SstFileReader::SetTableOptionsByMagicNumber(
|
||
|
uint64_t table_magic_number) {
|
||
|
assert(table_properties_);
|
||
|
if (table_magic_number == kBlockBasedTableMagicNumber ||
|
||
|
table_magic_number == kLegacyBlockBasedTableMagicNumber) {
|
||
|
options_.table_factory = std::make_shared<BlockBasedTableFactory>();
|
||
|
fprintf(stdout, "Sst file format: block-based\n");
|
||
|
auto& props = table_properties_->user_collected_properties;
|
||
|
auto pos = props.find(BlockBasedTablePropertyNames::kIndexType);
|
||
|
if (pos != props.end()) {
|
||
|
auto index_type_on_file = static_cast<BlockBasedTableOptions::IndexType>(
|
||
|
DecodeFixed32(pos->second.c_str()));
|
||
|
if (index_type_on_file ==
|
||
|
BlockBasedTableOptions::IndexType::kHashSearch) {
|
||
|
options_.prefix_extractor.reset(NewNoopTransform());
|
||
|
}
|
||
|
}
|
||
|
} else if (table_magic_number == kPlainTableMagicNumber ||
|
||
|
table_magic_number == kLegacyPlainTableMagicNumber) {
|
||
|
options_.allow_mmap_reads = true;
|
||
|
|
||
|
PlainTableOptions plain_table_options;
|
||
|
plain_table_options.user_key_len = kPlainTableVariableLength;
|
||
|
plain_table_options.bloom_bits_per_key = 0;
|
||
|
plain_table_options.hash_table_ratio = 0;
|
||
|
plain_table_options.index_sparseness = 1;
|
||
|
plain_table_options.huge_page_tlb_size = 0;
|
||
|
plain_table_options.encoding_type = kPlain;
|
||
|
plain_table_options.full_scan_mode = true;
|
||
|
|
||
|
options_.table_factory.reset(NewPlainTableFactory(plain_table_options));
|
||
|
fprintf(stdout, "Sst file format: plain table\n");
|
||
|
} else {
|
||
|
char error_msg_buffer[80];
|
||
|
snprintf(error_msg_buffer, sizeof(error_msg_buffer) - 1,
|
||
|
"Unsupported table magic number --- %lx",
|
||
|
(long)table_magic_number);
|
||
|
return Status::InvalidArgument(error_msg_buffer);
|
||
|
}
|
||
|
|
||
|
return Status::OK();
|
||
|
}
|
||
|
|
||
|
Status SstFileReader::SetOldTableOptions() {
|
||
|
assert(table_properties_ == nullptr);
|
||
|
options_.table_factory = std::make_shared<BlockBasedTableFactory>();
|
||
|
fprintf(stdout, "Sst file format: block-based(old version)\n");
|
||
|
|
||
|
return Status::OK();
|
||
|
}
|
||
|
|
||
|
Status SstFileReader::ReadSequential(bool print_kv,
|
||
|
uint64_t read_num,
|
||
|
bool has_from,
|
||
|
const std::string& from_key,
|
||
|
bool has_to,
|
||
|
const std::string& to_key) {
|
||
|
if (!table_reader_) {
|
||
|
return init_result_;
|
||
|
}
|
||
|
|
||
9 years ago
|
InternalIterator* iter =
|
||
|
table_reader_->NewIterator(ReadOptions(verify_checksum_, false));
|
||
10 years ago
|
uint64_t i = 0;
|
||
|
if (has_from) {
|
||
10 years ago
|
InternalKey ikey;
|
||
|
ikey.SetMaxPossibleForUserKey(from_key);
|
||
10 years ago
|
iter->Seek(ikey.Encode());
|
||
|
} else {
|
||
|
iter->SeekToFirst();
|
||
|
}
|
||
|
for (; iter->Valid(); iter->Next()) {
|
||
|
Slice key = iter->key();
|
||
|
Slice value = iter->value();
|
||
|
++i;
|
||
|
if (read_num > 0 && i > read_num)
|
||
|
break;
|
||
|
|
||
|
ParsedInternalKey ikey;
|
||
|
if (!ParseInternalKey(key, &ikey)) {
|
||
|
std::cerr << "Internal Key ["
|
||
|
<< key.ToString(true /* in hex*/)
|
||
|
<< "] parse error!\n";
|
||
|
continue;
|
||
|
}
|
||
|
|
||
|
// If end marker was specified, we stop before it
|
||
|
if (has_to && BytewiseComparator()->Compare(ikey.user_key, to_key) >= 0) {
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
if (print_kv) {
|
||
|
fprintf(stdout, "%s => %s\n",
|
||
|
ikey.DebugString(output_hex_).c_str(),
|
||
|
value.ToString(output_hex_).c_str());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
read_num_ += i;
|
||
|
|
||
|
Status ret = iter->status();
|
||
|
delete iter;
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
Status SstFileReader::ReadTableProperties(
|
||
|
std::shared_ptr<const TableProperties>* table_properties) {
|
||
|
if (!table_reader_) {
|
||
|
return init_result_;
|
||
|
}
|
||
|
|
||
|
*table_properties = table_reader_->GetTableProperties();
|
||
|
return init_result_;
|
||
|
}
|
||
|
|
||
|
namespace {
|
||
|
|
||
|
void print_help() {
|
||
|
fprintf(stderr,
|
||
10 years ago
|
"sst_dump [--command=check|scan|none|raw] [--verify_checksum] "
|
||
10 years ago
|
"--file=data_dir_OR_sst_file"
|
||
|
" [--output_hex]"
|
||
|
" [--input_key_hex]"
|
||
|
" [--from=<user_key>]"
|
||
|
" [--to=<user_key>]"
|
||
|
" [--read_num=NUM]"
|
||
10 years ago
|
" [--show_properties]"
|
||
|
" [--show_compression_sizes]"
|
||
|
" [--show_compression_sizes [--set_block_size=<block_size>]]\n");
|
||
10 years ago
|
}
|
||
|
|
||
|
} // namespace
|
||
|
|
||
10 years ago
|
int SSTDumpTool::Run(int argc, char** argv) {
|
||
10 years ago
|
const char* dir_or_file = nullptr;
|
||
|
uint64_t read_num = -1;
|
||
|
std::string command;
|
||
|
|
||
|
char junk;
|
||
|
uint64_t n;
|
||
|
bool verify_checksum = false;
|
||
|
bool output_hex = false;
|
||
|
bool input_key_hex = false;
|
||
|
bool has_from = false;
|
||
|
bool has_to = false;
|
||
|
bool show_properties = false;
|
||
10 years ago
|
bool show_compression_sizes = false;
|
||
|
bool set_block_size = false;
|
||
10 years ago
|
std::string from_key;
|
||
|
std::string to_key;
|
||
10 years ago
|
std::string block_size_str;
|
||
|
size_t block_size;
|
||
10 years ago
|
for (int i = 1; i < argc; i++) {
|
||
|
if (strncmp(argv[i], "--file=", 7) == 0) {
|
||
|
dir_or_file = argv[i] + 7;
|
||
|
} else if (strcmp(argv[i], "--output_hex") == 0) {
|
||
|
output_hex = true;
|
||
|
} else if (strcmp(argv[i], "--input_key_hex") == 0) {
|
||
|
input_key_hex = true;
|
||
|
} else if (sscanf(argv[i],
|
||
|
"--read_num=%lu%c",
|
||
|
(unsigned long*)&n, &junk) == 1) {
|
||
|
read_num = n;
|
||
|
} else if (strcmp(argv[i], "--verify_checksum") == 0) {
|
||
|
verify_checksum = true;
|
||
|
} else if (strncmp(argv[i], "--command=", 10) == 0) {
|
||
|
command = argv[i] + 10;
|
||
|
} else if (strncmp(argv[i], "--from=", 7) == 0) {
|
||
|
from_key = argv[i] + 7;
|
||
|
has_from = true;
|
||
|
} else if (strncmp(argv[i], "--to=", 5) == 0) {
|
||
|
to_key = argv[i] + 5;
|
||
|
has_to = true;
|
||
|
} else if (strcmp(argv[i], "--show_properties") == 0) {
|
||
|
show_properties = true;
|
||
10 years ago
|
} else if (strcmp(argv[i], "--show_compression_sizes") == 0) {
|
||
|
show_compression_sizes = true;
|
||
|
} else if (strncmp(argv[i], "--set_block_size=", 17) == 0) {
|
||
|
set_block_size = true;
|
||
|
block_size_str = argv[i] + 17;
|
||
|
std::istringstream iss(block_size_str);
|
||
|
if (iss.fail()) {
|
||
|
fprintf(stderr, "block size must be numeric");
|
||
|
exit(1);
|
||
|
}
|
||
|
iss >> block_size;
|
||
10 years ago
|
} else {
|
||
|
print_help();
|
||
|
exit(1);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (input_key_hex) {
|
||
|
if (has_from) {
|
||
9 years ago
|
from_key = rocksdb::LDBCommand::HexToString(from_key);
|
||
10 years ago
|
}
|
||
|
if (has_to) {
|
||
9 years ago
|
to_key = rocksdb::LDBCommand::HexToString(to_key);
|
||
10 years ago
|
}
|
||
|
}
|
||
|
|
||
|
if (dir_or_file == nullptr) {
|
||
|
print_help();
|
||
|
exit(1);
|
||
|
}
|
||
|
|
||
|
std::vector<std::string> filenames;
|
||
|
rocksdb::Env* env = rocksdb::Env::Default();
|
||
|
rocksdb::Status st = env->GetChildren(dir_or_file, &filenames);
|
||
|
bool dir = true;
|
||
|
if (!st.ok()) {
|
||
|
filenames.clear();
|
||
|
filenames.push_back(dir_or_file);
|
||
|
dir = false;
|
||
|
}
|
||
|
|
||
|
fprintf(stdout, "from [%s] to [%s]\n",
|
||
|
rocksdb::Slice(from_key).ToString(true).c_str(),
|
||
|
rocksdb::Slice(to_key).ToString(true).c_str());
|
||
|
|
||
|
uint64_t total_read = 0;
|
||
|
for (size_t i = 0; i < filenames.size(); i++) {
|
||
|
std::string filename = filenames.at(i);
|
||
|
if (filename.length() <= 4 ||
|
||
|
filename.rfind(".sst") != filename.length() - 4) {
|
||
|
// ignore
|
||
|
continue;
|
||
|
}
|
||
|
if (dir) {
|
||
|
filename = std::string(dir_or_file) + "/" + filename;
|
||
|
}
|
||
10 years ago
|
|
||
10 years ago
|
rocksdb::SstFileReader reader(filename, verify_checksum,
|
||
|
output_hex);
|
||
10 years ago
|
if (!reader.getStatus().ok()) {
|
||
|
fprintf(stderr, "%s: %s\n", filename.c_str(),
|
||
|
reader.getStatus().ToString().c_str());
|
||
|
exit(1);
|
||
|
}
|
||
|
|
||
10 years ago
|
if (show_compression_sizes) {
|
||
|
if (set_block_size) {
|
||
|
reader.ShowAllCompressionSizes(block_size);
|
||
|
} else {
|
||
|
reader.ShowAllCompressionSizes(16384);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
10 years ago
|
if (command == "raw") {
|
||
|
std::string out_filename = filename.substr(0, filename.length() - 4);
|
||
|
out_filename.append("_dump.txt");
|
||
|
|
||
|
st = reader.DumpTable(out_filename);
|
||
|
if (!st.ok()) {
|
||
|
fprintf(stderr, "%s: %s\n", filename.c_str(), st.ToString().c_str());
|
||
|
exit(1);
|
||
|
} else {
|
||
|
fprintf(stdout, "raw dump written to file %s\n", &out_filename[0]);
|
||
|
}
|
||
|
continue;
|
||
|
}
|
||
|
|
||
10 years ago
|
// scan all files in give file path.
|
||
|
if (command == "" || command == "scan" || command == "check") {
|
||
10 years ago
|
st = reader.ReadSequential(command == "scan",
|
||
10 years ago
|
read_num > 0 ? (read_num - total_read) :
|
||
|
read_num,
|
||
|
has_from, from_key, has_to, to_key);
|
||
|
if (!st.ok()) {
|
||
|
fprintf(stderr, "%s: %s\n", filename.c_str(),
|
||
|
st.ToString().c_str());
|
||
|
}
|
||
|
total_read += reader.GetReadNumber();
|
||
|
if (read_num > 0 && total_read > read_num) {
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
if (show_properties) {
|
||
|
const rocksdb::TableProperties* table_properties;
|
||
|
|
||
|
std::shared_ptr<const rocksdb::TableProperties>
|
||
|
table_properties_from_reader;
|
||
|
st = reader.ReadTableProperties(&table_properties_from_reader);
|
||
|
if (!st.ok()) {
|
||
|
fprintf(stderr, "%s: %s\n", filename.c_str(), st.ToString().c_str());
|
||
|
fprintf(stderr, "Try to use initial table properties\n");
|
||
|
table_properties = reader.GetInitTableProperties();
|
||
|
} else {
|
||
|
table_properties = table_properties_from_reader.get();
|
||
|
}
|
||
|
if (table_properties != nullptr) {
|
||
|
fprintf(stdout,
|
||
|
"Table Properties:\n"
|
||
|
"------------------------------\n"
|
||
|
" %s",
|
||
|
table_properties->ToString("\n ", ": ").c_str());
|
||
10 years ago
|
fprintf(stdout, "# deleted keys: %" PRIu64 "\n",
|
||
10 years ago
|
rocksdb::GetDeletedKeys(
|
||
|
table_properties->user_collected_properties));
|
||
|
}
|
||
|
}
|
||
|
}
|
||
10 years ago
|
return 0;
|
||
10 years ago
|
}
|
||
|
} // namespace rocksdb
|
||
10 years ago
|
|
||
|
#endif // ROCKSDB_LITE
|