]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/db/blob/blob_file_meta.cc
import quincy beta 17.1.0
[ceph.git] / ceph / src / rocksdb / db / blob / blob_file_meta.cc
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).
5
6 #include "db/blob/blob_file_meta.h"
7
8 #include <ostream>
9 #include <sstream>
10
11 namespace ROCKSDB_NAMESPACE {
12
13 std::string SharedBlobFileMetaData::DebugString() const {
14 std::ostringstream oss;
15 oss << (*this);
16
17 return oss.str();
18 }
19
20 std::ostream& operator<<(std::ostream& os,
21 const SharedBlobFileMetaData& shared_meta) {
22 os << "blob_file_number: " << shared_meta.GetBlobFileNumber()
23 << " total_blob_count: " << shared_meta.GetTotalBlobCount()
24 << " total_blob_bytes: " << shared_meta.GetTotalBlobBytes()
25 << " checksum_method: " << shared_meta.GetChecksumMethod()
26 << " checksum_value: " << shared_meta.GetChecksumValue();
27
28 return os;
29 }
30
31 std::string BlobFileMetaData::DebugString() const {
32 std::ostringstream oss;
33 oss << (*this);
34
35 return oss.str();
36 }
37
38 std::ostream& operator<<(std::ostream& os, const BlobFileMetaData& meta) {
39 const auto& shared_meta = meta.GetSharedMeta();
40 assert(shared_meta);
41 os << (*shared_meta);
42
43 os << " linked_ssts: {";
44 for (uint64_t file_number : meta.GetLinkedSsts()) {
45 os << ' ' << file_number;
46 }
47 os << " }";
48
49 os << " garbage_blob_count: " << meta.GetGarbageBlobCount()
50 << " garbage_blob_bytes: " << meta.GetGarbageBlobBytes();
51
52 return os;
53 }
54
55 } // namespace ROCKSDB_NAMESPACE