1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under both the GPLv2 (found in the
3 // COPYING file in the root directory) and Apache 2.0 License
4 // (found in the LICENSE.Apache file in the root directory).
11 #include "rocksdb/slice.h"
12 #include "rocksdb/status.h"
13 #include "util/file_reader_writer.h"
14 #include "utilities/blob_db/blob_log_format.h"
21 enum class DisplayType
{
30 Status
Run(const std::string
& filename
, DisplayType show_key
,
31 DisplayType show_blob
, DisplayType show_uncompressed_blob
,
35 std::unique_ptr
<RandomAccessFileReader
> reader_
;
36 std::unique_ptr
<char> buffer_
;
39 Status
Read(uint64_t offset
, size_t size
, Slice
* result
);
40 Status
DumpBlobLogHeader(uint64_t* offset
, CompressionType
* compression
);
41 Status
DumpBlobLogFooter(uint64_t file_size
, uint64_t* footer_offset
);
42 Status
DumpRecord(DisplayType show_key
, DisplayType show_blob
,
43 DisplayType show_uncompressed_blob
, bool show_summary
,
44 CompressionType compression
, uint64_t* offset
,
45 uint64_t* total_records
, uint64_t* total_key_size
,
46 uint64_t* total_blob_size
,
47 uint64_t* total_uncompressed_blob_size
);
48 void DumpSlice(const Slice s
, DisplayType type
);
51 std::string
GetString(std::pair
<T
, T
> p
);
54 } // namespace blob_db
55 } // namespace rocksdb
57 #endif // ROCKSDB_LITE