From 37a635cfe64c5a495f85290a1076574ab95a4bf0 Mon Sep 17 00:00:00 2001 From: Levi Tamasi Date: Wed, 11 Mar 2020 14:41:34 -0700 Subject: [PATCH] Disambiguate CustomFieldTags for the unity build (#6513) Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/6513 Test Plan: `make unity_test` Differential Revision: D20388919 Pulled By: ltamasi fbshipit-source-id: 88dbceab0723a54ee3939e1644e13dc9a4c70420 --- db/blob_file_addition.cc | 6 +----- db/blob_file_addition.h | 2 ++ db/blob_file_garbage.cc | 6 +----- db/blob_file_garbage.h | 2 ++ 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/db/blob_file_addition.cc b/db/blob_file_addition.cc index 994b23b1e..a346cf66b 100644 --- a/db/blob_file_addition.cc +++ b/db/blob_file_addition.cc @@ -16,11 +16,9 @@ namespace ROCKSDB_NAMESPACE { -namespace { - // Tags for custom fields. Note that these get persisted in the manifest, // so existing tags should not be modified. -enum CustomFieldTags : uint32_t { +enum BlobFileAddition::CustomFieldTags : uint32_t { kEndMarker, // Add forward compatible fields here @@ -32,8 +30,6 @@ enum CustomFieldTags : uint32_t { // Add forward incompatible fields here }; -} // anonymous namespace - void BlobFileAddition::EncodeTo(std::string* output) const { PutVarint64(output, blob_file_number_); PutVarint64(output, total_blob_count_); diff --git a/db/blob_file_addition.h b/db/blob_file_addition.h index 8241038b2..fab50160d 100644 --- a/db/blob_file_addition.h +++ b/db/blob_file_addition.h @@ -47,6 +47,8 @@ class BlobFileAddition { std::string DebugJSON() const; private: + enum CustomFieldTags : uint32_t; + uint64_t blob_file_number_ = kInvalidBlobFileNumber; uint64_t total_blob_count_ = 0; uint64_t total_blob_bytes_ = 0; diff --git a/db/blob_file_garbage.cc b/db/blob_file_garbage.cc index 2d399bf44..e4dde6c09 100644 --- a/db/blob_file_garbage.cc +++ b/db/blob_file_garbage.cc @@ -16,11 +16,9 @@ namespace ROCKSDB_NAMESPACE { -namespace { - // Tags for custom fields. Note that these get persisted in the manifest, // so existing tags should not be modified. -enum CustomFieldTags : uint32_t { +enum BlobFileGarbage::CustomFieldTags : uint32_t { kEndMarker, // Add forward compatible fields here @@ -32,8 +30,6 @@ enum CustomFieldTags : uint32_t { // Add forward incompatible fields here }; -} // anonymous namespace - void BlobFileGarbage::EncodeTo(std::string* output) const { PutVarint64(output, blob_file_number_); PutVarint64(output, garbage_blob_count_); diff --git a/db/blob_file_garbage.h b/db/blob_file_garbage.h index ae6c23231..4b61fb9c0 100644 --- a/db/blob_file_garbage.h +++ b/db/blob_file_garbage.h @@ -39,6 +39,8 @@ class BlobFileGarbage { std::string DebugJSON() const; private: + enum CustomFieldTags : uint32_t; + uint64_t blob_file_number_ = kInvalidBlobFileNumber; uint64_t garbage_blob_count_ = 0; uint64_t garbage_blob_bytes_ = 0;