]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/db/blob/blob_file_garbage.h
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).
12 #include "db/blob/blob_constants.h"
13 #include "rocksdb/rocksdb_namespace.h"
15 namespace ROCKSDB_NAMESPACE
{
21 class BlobFileGarbage
{
23 BlobFileGarbage() = default;
25 BlobFileGarbage(uint64_t blob_file_number
, uint64_t garbage_blob_count
,
26 uint64_t garbage_blob_bytes
)
27 : blob_file_number_(blob_file_number
),
28 garbage_blob_count_(garbage_blob_count
),
29 garbage_blob_bytes_(garbage_blob_bytes
) {}
31 uint64_t GetBlobFileNumber() const { return blob_file_number_
; }
32 uint64_t GetGarbageBlobCount() const { return garbage_blob_count_
; }
33 uint64_t GetGarbageBlobBytes() const { return garbage_blob_bytes_
; }
35 void EncodeTo(std::string
* output
) const;
36 Status
DecodeFrom(Slice
* input
);
38 std::string
DebugString() const;
39 std::string
DebugJSON() const;
42 enum CustomFieldTags
: uint32_t;
44 uint64_t blob_file_number_
= kInvalidBlobFileNumber
;
45 uint64_t garbage_blob_count_
= 0;
46 uint64_t garbage_blob_bytes_
= 0;
49 bool operator==(const BlobFileGarbage
& lhs
, const BlobFileGarbage
& rhs
);
50 bool operator!=(const BlobFileGarbage
& lhs
, const BlobFileGarbage
& rhs
);
52 std::ostream
& operator<<(std::ostream
& os
,
53 const BlobFileGarbage
& blob_file_garbage
);
54 JSONWriter
& operator<<(JSONWriter
& jw
,
55 const BlobFileGarbage
& blob_file_garbage
);
57 } // namespace ROCKSDB_NAMESPACE