Skip to content

Commit 83d24db

Browse files
mszeszko-metameta-codesync[bot]
authored andcommitted
Remove unused public APIs (facebook#14277)
Summary: Pull Request resolved: facebook#14277 Remove `GetBlobDBOptions()` and `SyncBlobFiles()` from the public `BlobDB` interface. These methods were only used internally or in tests and are not needed by any production code. `GetBlobDBOptions()` is now replaced by storing bdb_options_ as a member in the test class. `SyncBlobFiles()` is moved to private in `BlobDBImpl` since it's only called internally. Also remove unused `kDeleteCheckPeriodMillisecs` constant. Reviewed By: xingbowang Differential Revision: D91089111 fbshipit-source-id: 9c92b6d9563cf241c69d8880b418e8bcb7acb6c5
1 parent 374c8dd commit 83d24db

4 files changed

Lines changed: 5 additions & 15 deletions

File tree

utilities/blob_db/blob_db.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,6 @@ class BlobDB : public StackableDB {
174174
std::vector<ColumnFamilyHandle*>* handles,
175175
BlobDB** blob_db);
176176

177-
virtual BlobDBOptions GetBlobDBOptions() const = 0;
178-
179-
virtual Status SyncBlobFiles(const WriteOptions& write_options) = 0;
180-
181177
~BlobDB() override {}
182178

183179
protected:

utilities/blob_db/blob_db_impl.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ Status BlobDBImpl::CloseImpl() {
131131
return s;
132132
}
133133

134-
BlobDBOptions BlobDBImpl::GetBlobDBOptions() const { return bdb_options_; }
135-
136134
Status BlobDBImpl::Open(std::vector<ColumnFamilyHandle*>* handles) {
137135
assert(handles != nullptr);
138136
assert(db_ == nullptr);

utilities/blob_db/blob_db_impl.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ class BlobDBImpl : public BlobDB {
7575
friend class BlobIndexCompactionFilterGC;
7676

7777
public:
78-
// deletions check period
79-
static constexpr uint32_t kDeleteCheckPeriodMillisecs = 2 * 1000;
80-
8178
// sanity check task
8279
static constexpr uint32_t kSanityCheckPeriodMillisecs = 20 * 60 * 1000;
8380

@@ -140,8 +137,6 @@ class BlobDBImpl : public BlobDB {
140137
std::vector<std::string>* const output_file_names = nullptr,
141138
CompactionJobInfo* compaction_job_info = nullptr) override;
142139

143-
BlobDBOptions GetBlobDBOptions() const override;
144-
145140
BlobDBImpl(const std::string& dbname, const BlobDBOptions& bdb_options,
146141
const DBOptions& db_options,
147142
const ColumnFamilyOptions& cf_options);
@@ -161,8 +156,6 @@ class BlobDBImpl : public BlobDB {
161156

162157
Status Open(std::vector<ColumnFamilyHandle*>* handles);
163158

164-
Status SyncBlobFiles(const WriteOptions& write_options) override;
165-
166159
// Common part of the two GetCompactionContext methods below.
167160
// REQUIRES: read lock on mutex_
168161
void GetCompactionContextCommon(BlobCompactionContext* context);
@@ -214,6 +207,8 @@ class BlobDBImpl : public BlobDB {
214207
// Return true if a snapshot is created.
215208
bool SetSnapshotIfNeeded(ReadOptions* read_options);
216209

210+
Status SyncBlobFiles(const WriteOptions& write_options);
211+
217212
Status GetImpl(const ReadOptions& read_options,
218213
ColumnFamilyHandle* column_family, const Slice& key,
219214
PinnableSlice* value, uint64_t* expiration = nullptr);

utilities/blob_db/blob_db_test.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ class BlobDBTest : public testing::Test {
8484
options.stats_dump_period_sec = 0;
8585
options.stats_persist_period_sec = 0;
8686
}
87+
bdb_options_ = bdb_options;
8788
return BlobDB::Open(options, bdb_options, dbname_, &blob_db_);
8889
}
8990

@@ -109,10 +110,9 @@ class BlobDBTest : public testing::Test {
109110
void Destroy() {
110111
if (blob_db_) {
111112
Options options = blob_db_->GetOptions();
112-
BlobDBOptions bdb_options = blob_db_->GetBlobDBOptions();
113113
delete blob_db_;
114114
blob_db_ = nullptr;
115-
ASSERT_OK(DestroyBlobDB(dbname_, options, bdb_options));
115+
ASSERT_OK(DestroyBlobDB(dbname_, options, bdb_options_));
116116
}
117117
}
118118

@@ -295,6 +295,7 @@ class BlobDBTest : public testing::Test {
295295
std::unique_ptr<Env> mock_env_;
296296
std::unique_ptr<FaultInjectionTestEnv> fault_injection_env_;
297297
BlobDB* blob_db_;
298+
BlobDBOptions bdb_options_;
298299
}; // class BlobDBTest
299300

300301
TEST_F(BlobDBTest, Put) {

0 commit comments

Comments
 (0)