2017-05-23 19:30:04 +02:00
|
|
|
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
|
2017-07-16 01:03:42 +02:00
|
|
|
// This source code is licensed under both the GPLv2 (found in the
|
|
|
|
// COPYING file in the root directory) and Apache 2.0 License
|
|
|
|
// (found in the LICENSE.Apache file in the root directory).
|
2017-05-23 19:30:04 +02:00
|
|
|
#ifndef ROCKSDB_LITE
|
Fix build errors in blob_dump_tool with GCC 4.8
Summary:
Fixing the build errors seen with GCC 4.8.1.
```
Makefile:105: Warning: Compiling in debug mode. Don't use the resulting binary in production
utilities/blob_db/blob_dump_tool.cc: In member function ‘rocksdb::Status rocksdb::blob_db::BlobDumpTool::DumpBlobLogFooter(uint64_t, uint64_t*)’:
utilities/blob_db/blob_dump_tool.cc:149:42: error: expected ‘)’ before ‘PRIu64’
fprintf(stdout, " Blob count : %" PRIu64 "\n", footer.GetBlobCount());
^
utilities/blob_db/blob_dump_tool.cc:149:76: error: spurious trailing ‘%’ in format [-Werror=format=]
fprintf(stdout, " Blob count : %" PRIu64 "\n", footer.GetBlobCount());
^
utilities/blob_db/blob_dump_tool.cc:149:76: error: too many arguments for format [-Werror=format-extra-args]
utilities/blob_db/blob_dump_tool.cc: In member function ‘rocksdb::Status rocksdb::blob_db::BlobDumpTool::DumpRecord(rocksdb::blob_db::BlobDumpTool::DisplayType, rocksdb::blob_db::BlobDumpTool::DisplayType, uint64_t*)’:
utilities/blob_db/blob_dump_tool.cc:161:49: error: expected ‘)’ before ‘PRIx64’
fprintf(stdout, "Read record with offset 0x%" PRIx64 " (%" PRIu64 "):\n",
^
utilities/blob_db/blob_dump_tool.cc:162:27: error: spurious trailing ‘%’ in format [-Werror=format=]
*offset, *offset);
^
utilities/blob_db/blob_dump_tool.cc:162:27: error: too many arguments for format [-Werror=format-extra-args]
utilities/blob_db/blob_dump_tool.cc:176:38: error: expected ‘)’ before ‘PRIu64’
fprintf(stdout, " blob size : %" PRIu64 "\n", record.GetBlobSize());
^
utilities/blob_db/blob_dump_tool.cc:176:71: error: spurious trailing ‘%’ in format [-Werror=format=]
fprintf(stdout, " blob size : %" PRIu64 "\n", record.GetBlobSize());
^
utilities/blob_db/blob_dump_tool.cc:176:71: error: too many arguments for format [-Werror=format-extra-args]
utilities/blob_db/blob_dump_tool.cc:178:38: error: expected ‘)’ before ‘PRIu64’
fprintf(stdout, " time : %" PRIu64 "\n", record.GetTimeVal());
^
utilities/blob_db/blob_dump_tool.cc:178:70: error: spurious trailing ‘%’ in format [-Werror=format=]
fprintf(stdout, " time : %" PRIu64 "\n", record.GetTimeVal());
^
utilities/blob_db/blob_dump_tool.cc:178:70: error: too many arguments for format [-Werror=format-extra-args]
utilities/blob_db/blob_dump_tool.cc:214:38: error: expected ‘)’ before ‘PRIu64’
fprintf(stdout, " sequence : %" PRIu64 "\n", record.GetSN());
^
utilities/blob_db/blob_dump_tool.cc:214:65: error: spurious trailing ‘%’ in format [-Werror=format=]
fprintf(stdout, " sequence : %" PRIu64 "\n", record.GetSN());
```
Closes https://github.com/facebook/rocksdb/pull/2359
Differential Revision: D5117684
Pulled By: sagar0
fbshipit-source-id: 7480346bcd96205fcae890927c5e68cf004e87be
2017-05-24 09:03:14 +02:00
|
|
|
|
2017-05-23 19:30:04 +02:00
|
|
|
#include "utilities/blob_db/blob_dump_tool.h"
|
|
|
|
#include <stdio.h>
|
2019-09-16 19:31:27 +02:00
|
|
|
#include <cinttypes>
|
2017-05-23 19:30:04 +02:00
|
|
|
#include <iostream>
|
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
Introduce a new storage specific Env API (#5761)
Summary:
The current Env API encompasses both storage/file operations, as well as OS related operations. Most of the APIs return a Status, which does not have enough metadata about an error, such as whether its retry-able or not, scope (i.e fault domain) of the error etc., that may be required in order to properly handle a storage error. The file APIs also do not provide enough control over the IO SLA, such as timeout, prioritization, hinting about placement and redundancy etc.
This PR separates out the file/storage APIs from Env into a new FileSystem class. The APIs are updated to return an IOStatus with metadata about the error, as well as to take an IOOptions structure as input in order to allow more control over the IO.
The user can set both ```options.env``` and ```options.file_system``` to specify that RocksDB should use the former for OS related operations and the latter for storage operations. Internally, a ```CompositeEnvWrapper``` has been introduced that inherits from ```Env``` and redirects individual methods to either an ```Env``` implementation or the ```FileSystem``` as appropriate. When options are sanitized during ```DB::Open```, ```options.env``` is replaced with a newly allocated ```CompositeEnvWrapper``` instance if both env and file_system have been specified. This way, the rest of the RocksDB code can continue to function as before.
This PR also ports PosixEnv to the new API by splitting it into two - PosixEnv and PosixFileSystem. PosixEnv is defined as a sub-class of CompositeEnvWrapper, and threading/time functions are overridden with Posix specific implementations in order to avoid an extra level of indirection.
The ```CompositeEnvWrapper``` translates ```IOStatus``` return code to ```Status```, and sets the severity to ```kSoftError``` if the io_status is retryable. The error handling code in RocksDB can then recover the DB automatically.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5761
Differential Revision: D18868376
Pulled By: anand1976
fbshipit-source-id: 39efe18a162ea746fabac6360ff529baba48486f
2019-12-13 23:47:08 +01:00
|
|
|
#include "env/composite_env_wrapper.h"
|
2019-09-16 19:31:27 +02:00
|
|
|
#include "file/random_access_file_reader.h"
|
|
|
|
#include "file/readahead_raf.h"
|
2017-05-23 19:30:04 +02:00
|
|
|
#include "port/port.h"
|
|
|
|
#include "rocksdb/convenience.h"
|
|
|
|
#include "rocksdb/env.h"
|
2018-04-05 20:00:52 +02:00
|
|
|
#include "table/format.h"
|
2017-05-23 19:30:04 +02:00
|
|
|
#include "util/coding.h"
|
|
|
|
#include "util/string_util.h"
|
|
|
|
|
2020-02-20 21:07:53 +01:00
|
|
|
namespace ROCKSDB_NAMESPACE {
|
2017-05-23 19:30:04 +02:00
|
|
|
namespace blob_db {
|
|
|
|
|
|
|
|
BlobDumpTool::BlobDumpTool()
|
|
|
|
: reader_(nullptr), buffer_(nullptr), buffer_size_(0) {}
|
|
|
|
|
|
|
|
Status BlobDumpTool::Run(const std::string& filename, DisplayType show_key,
|
2018-04-05 20:00:52 +02:00
|
|
|
DisplayType show_blob,
|
|
|
|
DisplayType show_uncompressed_blob,
|
|
|
|
bool show_summary) {
|
2018-06-24 08:08:33 +02:00
|
|
|
constexpr size_t kReadaheadSize = 2 * 1024 * 1024;
|
2017-05-23 19:30:04 +02:00
|
|
|
Status s;
|
|
|
|
Env* env = Env::Default();
|
|
|
|
s = env->FileExists(filename);
|
|
|
|
if (!s.ok()) {
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
uint64_t file_size = 0;
|
|
|
|
s = env->GetFileSize(filename, &file_size);
|
|
|
|
if (!s.ok()) {
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
std::unique_ptr<RandomAccessFile> file;
|
|
|
|
s = env->NewRandomAccessFile(filename, &file, EnvOptions());
|
|
|
|
if (!s.ok()) {
|
|
|
|
return s;
|
|
|
|
}
|
2018-06-24 08:08:33 +02:00
|
|
|
file = NewReadaheadRandomAccessFile(std::move(file), kReadaheadSize);
|
2017-05-23 19:30:04 +02:00
|
|
|
if (file_size == 0) {
|
|
|
|
return Status::Corruption("File is empty.");
|
|
|
|
}
|
Introduce a new storage specific Env API (#5761)
Summary:
The current Env API encompasses both storage/file operations, as well as OS related operations. Most of the APIs return a Status, which does not have enough metadata about an error, such as whether its retry-able or not, scope (i.e fault domain) of the error etc., that may be required in order to properly handle a storage error. The file APIs also do not provide enough control over the IO SLA, such as timeout, prioritization, hinting about placement and redundancy etc.
This PR separates out the file/storage APIs from Env into a new FileSystem class. The APIs are updated to return an IOStatus with metadata about the error, as well as to take an IOOptions structure as input in order to allow more control over the IO.
The user can set both ```options.env``` and ```options.file_system``` to specify that RocksDB should use the former for OS related operations and the latter for storage operations. Internally, a ```CompositeEnvWrapper``` has been introduced that inherits from ```Env``` and redirects individual methods to either an ```Env``` implementation or the ```FileSystem``` as appropriate. When options are sanitized during ```DB::Open```, ```options.env``` is replaced with a newly allocated ```CompositeEnvWrapper``` instance if both env and file_system have been specified. This way, the rest of the RocksDB code can continue to function as before.
This PR also ports PosixEnv to the new API by splitting it into two - PosixEnv and PosixFileSystem. PosixEnv is defined as a sub-class of CompositeEnvWrapper, and threading/time functions are overridden with Posix specific implementations in order to avoid an extra level of indirection.
The ```CompositeEnvWrapper``` translates ```IOStatus``` return code to ```Status```, and sets the severity to ```kSoftError``` if the io_status is retryable. The error handling code in RocksDB can then recover the DB automatically.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5761
Differential Revision: D18868376
Pulled By: anand1976
fbshipit-source-id: 39efe18a162ea746fabac6360ff529baba48486f
2019-12-13 23:47:08 +01:00
|
|
|
reader_.reset(new RandomAccessFileReader(
|
|
|
|
NewLegacyRandomAccessFileWrapper(file), filename));
|
2017-05-23 19:30:04 +02:00
|
|
|
uint64_t offset = 0;
|
|
|
|
uint64_t footer_offset = 0;
|
2018-04-05 20:00:52 +02:00
|
|
|
CompressionType compression = kNoCompression;
|
|
|
|
s = DumpBlobLogHeader(&offset, &compression);
|
2017-05-23 19:30:04 +02:00
|
|
|
if (!s.ok()) {
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
s = DumpBlobLogFooter(file_size, &footer_offset);
|
|
|
|
if (!s.ok()) {
|
|
|
|
return s;
|
|
|
|
}
|
2018-04-05 20:00:52 +02:00
|
|
|
uint64_t total_records = 0;
|
|
|
|
uint64_t total_key_size = 0;
|
|
|
|
uint64_t total_blob_size = 0;
|
|
|
|
uint64_t total_uncompressed_blob_size = 0;
|
|
|
|
if (show_key != DisplayType::kNone || show_summary) {
|
2017-05-23 19:30:04 +02:00
|
|
|
while (offset < footer_offset) {
|
2018-04-05 20:00:52 +02:00
|
|
|
s = DumpRecord(show_key, show_blob, show_uncompressed_blob, show_summary,
|
|
|
|
compression, &offset, &total_records, &total_key_size,
|
|
|
|
&total_blob_size, &total_uncompressed_blob_size);
|
2017-05-23 19:30:04 +02:00
|
|
|
if (!s.ok()) {
|
2018-04-05 20:00:52 +02:00
|
|
|
break;
|
2017-05-23 19:30:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-04-05 20:00:52 +02:00
|
|
|
if (show_summary) {
|
|
|
|
fprintf(stdout, "Summary:\n");
|
|
|
|
fprintf(stdout, " total records: %" PRIu64 "\n", total_records);
|
|
|
|
fprintf(stdout, " total key size: %" PRIu64 "\n", total_key_size);
|
|
|
|
fprintf(stdout, " total blob size: %" PRIu64 "\n", total_blob_size);
|
|
|
|
if (compression != kNoCompression) {
|
|
|
|
fprintf(stdout, " total raw blob size: %" PRIu64 "\n",
|
|
|
|
total_uncompressed_blob_size);
|
|
|
|
}
|
|
|
|
}
|
2017-05-23 19:30:04 +02:00
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
Status BlobDumpTool::Read(uint64_t offset, size_t size, Slice* result) {
|
|
|
|
if (buffer_size_ < size) {
|
|
|
|
if (buffer_size_ == 0) {
|
|
|
|
buffer_size_ = 4096;
|
|
|
|
}
|
|
|
|
while (buffer_size_ < size) {
|
|
|
|
buffer_size_ *= 2;
|
|
|
|
}
|
|
|
|
buffer_.reset(new char[buffer_size_]);
|
|
|
|
}
|
2020-04-30 23:48:51 +02:00
|
|
|
Status s =
|
|
|
|
reader_->Read(IOOptions(), offset, size, result, buffer_.get(), nullptr);
|
2017-05-23 19:30:04 +02:00
|
|
|
if (!s.ok()) {
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
if (result->size() != size) {
|
|
|
|
return Status::Corruption("Reach the end of the file unexpectedly.");
|
|
|
|
}
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
2018-04-05 20:00:52 +02:00
|
|
|
Status BlobDumpTool::DumpBlobLogHeader(uint64_t* offset,
|
|
|
|
CompressionType* compression) {
|
2017-05-23 19:30:04 +02:00
|
|
|
Slice slice;
|
2017-10-27 22:14:34 +02:00
|
|
|
Status s = Read(0, BlobLogHeader::kSize, &slice);
|
2017-05-23 19:30:04 +02:00
|
|
|
if (!s.ok()) {
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
BlobLogHeader header;
|
|
|
|
s = header.DecodeFrom(slice);
|
|
|
|
if (!s.ok()) {
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
fprintf(stdout, "Blob log header:\n");
|
2017-10-27 22:14:34 +02:00
|
|
|
fprintf(stdout, " Version : %" PRIu32 "\n", header.version);
|
|
|
|
fprintf(stdout, " Column Family ID : %" PRIu32 "\n",
|
|
|
|
header.column_family_id);
|
2017-05-23 19:30:04 +02:00
|
|
|
std::string compression_str;
|
2017-10-27 22:14:34 +02:00
|
|
|
if (!GetStringFromCompressionType(&compression_str, header.compression)
|
|
|
|
.ok()) {
|
2017-05-23 19:30:04 +02:00
|
|
|
compression_str = "Unrecongnized compression type (" +
|
2017-10-27 22:14:34 +02:00
|
|
|
ToString((int)header.compression) + ")";
|
|
|
|
}
|
|
|
|
fprintf(stdout, " Compression : %s\n", compression_str.c_str());
|
|
|
|
fprintf(stdout, " Expiration range : %s\n",
|
|
|
|
GetString(header.expiration_range).c_str());
|
|
|
|
*offset = BlobLogHeader::kSize;
|
2018-04-05 20:00:52 +02:00
|
|
|
*compression = header.compression;
|
2017-05-23 19:30:04 +02:00
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
Status BlobDumpTool::DumpBlobLogFooter(uint64_t file_size,
|
|
|
|
uint64_t* footer_offset) {
|
|
|
|
auto no_footer = [&]() {
|
|
|
|
*footer_offset = file_size;
|
|
|
|
fprintf(stdout, "No blob log footer.\n");
|
|
|
|
return Status::OK();
|
|
|
|
};
|
2017-10-27 22:14:34 +02:00
|
|
|
if (file_size < BlobLogHeader::kSize + BlobLogFooter::kSize) {
|
2017-05-23 19:30:04 +02:00
|
|
|
return no_footer();
|
|
|
|
}
|
|
|
|
Slice slice;
|
2017-10-27 22:14:34 +02:00
|
|
|
*footer_offset = file_size - BlobLogFooter::kSize;
|
|
|
|
Status s = Read(*footer_offset, BlobLogFooter::kSize, &slice);
|
2017-05-23 19:30:04 +02:00
|
|
|
if (!s.ok()) {
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
BlobLogFooter footer;
|
|
|
|
s = footer.DecodeFrom(slice);
|
|
|
|
if (!s.ok()) {
|
2018-04-05 20:00:52 +02:00
|
|
|
return no_footer();
|
2017-05-23 19:30:04 +02:00
|
|
|
}
|
|
|
|
fprintf(stdout, "Blob log footer:\n");
|
2017-10-27 22:14:34 +02:00
|
|
|
fprintf(stdout, " Blob count : %" PRIu64 "\n", footer.blob_count);
|
|
|
|
fprintf(stdout, " Expiration Range : %s\n",
|
|
|
|
GetString(footer.expiration_range).c_str());
|
2017-05-23 19:30:04 +02:00
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
Status BlobDumpTool::DumpRecord(DisplayType show_key, DisplayType show_blob,
|
2018-04-05 20:00:52 +02:00
|
|
|
DisplayType show_uncompressed_blob,
|
|
|
|
bool show_summary, CompressionType compression,
|
|
|
|
uint64_t* offset, uint64_t* total_records,
|
|
|
|
uint64_t* total_key_size,
|
|
|
|
uint64_t* total_blob_size,
|
|
|
|
uint64_t* total_uncompressed_blob_size) {
|
|
|
|
if (show_key != DisplayType::kNone) {
|
|
|
|
fprintf(stdout, "Read record with offset 0x%" PRIx64 " (%" PRIu64 "):\n",
|
|
|
|
*offset, *offset);
|
|
|
|
}
|
2017-05-23 19:30:04 +02:00
|
|
|
Slice slice;
|
|
|
|
Status s = Read(*offset, BlobLogRecord::kHeaderSize, &slice);
|
|
|
|
if (!s.ok()) {
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
BlobLogRecord record;
|
|
|
|
s = record.DecodeHeaderFrom(slice);
|
|
|
|
if (!s.ok()) {
|
|
|
|
return s;
|
|
|
|
}
|
2017-10-27 22:14:34 +02:00
|
|
|
uint64_t key_size = record.key_size;
|
|
|
|
uint64_t value_size = record.value_size;
|
2018-04-05 20:00:52 +02:00
|
|
|
if (show_key != DisplayType::kNone) {
|
|
|
|
fprintf(stdout, " key size : %" PRIu64 "\n", key_size);
|
|
|
|
fprintf(stdout, " value size : %" PRIu64 "\n", value_size);
|
|
|
|
fprintf(stdout, " expiration : %" PRIu64 "\n", record.expiration);
|
|
|
|
}
|
2017-05-23 19:30:04 +02:00
|
|
|
*offset += BlobLogRecord::kHeaderSize;
|
2018-09-06 03:07:53 +02:00
|
|
|
s = Read(*offset, static_cast<size_t>(key_size + value_size), &slice);
|
2017-05-23 19:30:04 +02:00
|
|
|
if (!s.ok()) {
|
|
|
|
return s;
|
|
|
|
}
|
2018-04-05 20:00:52 +02:00
|
|
|
// Decompress value
|
|
|
|
std::string uncompressed_value;
|
|
|
|
if (compression != kNoCompression &&
|
|
|
|
(show_uncompressed_blob != DisplayType::kNone || show_summary)) {
|
|
|
|
BlockContents contents;
|
2019-01-19 04:10:17 +01:00
|
|
|
UncompressionContext context(compression);
|
|
|
|
UncompressionInfo info(context, UncompressionDict::GetEmptyDict(),
|
|
|
|
compression);
|
2018-04-05 20:00:52 +02:00
|
|
|
s = UncompressBlockContentsForCompressionType(
|
2019-01-19 04:10:17 +01:00
|
|
|
info, slice.data() + key_size, static_cast<size_t>(value_size),
|
|
|
|
&contents, 2 /*compress_format_version*/,
|
|
|
|
ImmutableCFOptions(Options()));
|
2018-04-05 20:00:52 +02:00
|
|
|
if (!s.ok()) {
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
uncompressed_value = contents.data.ToString();
|
|
|
|
}
|
2017-05-23 19:30:04 +02:00
|
|
|
if (show_key != DisplayType::kNone) {
|
|
|
|
fprintf(stdout, " key : ");
|
2018-09-06 03:07:53 +02:00
|
|
|
DumpSlice(Slice(slice.data(), static_cast<size_t>(key_size)), show_key);
|
2017-05-23 19:30:04 +02:00
|
|
|
if (show_blob != DisplayType::kNone) {
|
|
|
|
fprintf(stdout, " blob : ");
|
2018-09-06 03:07:53 +02:00
|
|
|
DumpSlice(Slice(slice.data() + static_cast<size_t>(key_size), static_cast<size_t>(value_size)), show_blob);
|
2017-05-23 19:30:04 +02:00
|
|
|
}
|
2018-04-05 20:00:52 +02:00
|
|
|
if (show_uncompressed_blob != DisplayType::kNone) {
|
|
|
|
fprintf(stdout, " raw blob : ");
|
|
|
|
DumpSlice(Slice(uncompressed_value), show_uncompressed_blob);
|
|
|
|
}
|
2017-05-23 19:30:04 +02:00
|
|
|
}
|
2017-10-27 22:14:34 +02:00
|
|
|
*offset += key_size + value_size;
|
2018-04-05 20:00:52 +02:00
|
|
|
*total_records += 1;
|
|
|
|
*total_key_size += key_size;
|
|
|
|
*total_blob_size += value_size;
|
|
|
|
*total_uncompressed_blob_size += uncompressed_value.size();
|
2017-05-23 19:30:04 +02:00
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
void BlobDumpTool::DumpSlice(const Slice s, DisplayType type) {
|
|
|
|
if (type == DisplayType::kRaw) {
|
|
|
|
fprintf(stdout, "%s\n", s.ToString().c_str());
|
|
|
|
} else if (type == DisplayType::kHex) {
|
|
|
|
fprintf(stdout, "%s\n", s.ToString(true /*hex*/).c_str());
|
|
|
|
} else if (type == DisplayType::kDetail) {
|
|
|
|
char buf[100];
|
|
|
|
for (size_t i = 0; i < s.size(); i += 16) {
|
|
|
|
memset(buf, 0, sizeof(buf));
|
|
|
|
for (size_t j = 0; j < 16 && i + j < s.size(); j++) {
|
|
|
|
unsigned char c = s[i + j];
|
|
|
|
snprintf(buf + j * 3 + 15, 2, "%x", c >> 4);
|
|
|
|
snprintf(buf + j * 3 + 16, 2, "%x", c & 0xf);
|
|
|
|
snprintf(buf + j + 65, 2, "%c", (0x20 <= c && c <= 0x7e) ? c : '.');
|
|
|
|
}
|
2020-06-03 00:02:44 +02:00
|
|
|
for (size_t p = 0; p + 1 < sizeof(buf); p++) {
|
2017-05-23 19:30:04 +02:00
|
|
|
if (buf[p] == 0) {
|
|
|
|
buf[p] = ' ';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fprintf(stdout, "%s\n", i == 0 ? buf + 15 : buf);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class T>
|
|
|
|
std::string BlobDumpTool::GetString(std::pair<T, T> p) {
|
|
|
|
if (p.first == 0 && p.second == 0) {
|
|
|
|
return "nil";
|
|
|
|
}
|
|
|
|
return "(" + ToString(p.first) + ", " + ToString(p.second) + ")";
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace blob_db
|
2020-02-20 21:07:53 +01:00
|
|
|
} // namespace ROCKSDB_NAMESPACE
|
2017-05-23 19:30:04 +02:00
|
|
|
|
|
|
|
#endif // ROCKSDB_LITE
|