Skip to content

Commit

Permalink
Add virtual func IsDeleteRangeSupported
Browse files Browse the repository at this point in the history
Summary:
this modify allows third-party tables able to support delete range
Closes #2035

Differential Revision: D5407973

Pulled By: ajkr

fbshipit-source-id: 82e364b7dd5a198660788d59543f15b8f95cc418
  • Loading branch information
mm304321141 authored and facebook-github-bot committed Jul 12, 2017
1 parent 7550255 commit 70440f7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db/column_family.cc
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ ColumnFamilyData::ColumnFamilyData(
initial_cf_options_(SanitizeOptions(db_options, cf_options)),
ioptions_(db_options, initial_cf_options_),
mutable_cf_options_(initial_cf_options_),
is_delete_range_supported_(strcmp(cf_options.table_factory->Name(),
BlockBasedTableFactory().Name()) == 0),
is_delete_range_supported_(
cf_options.table_factory->IsDeleteRangeSupported()),
write_buffer_manager_(write_buffer_manager),
mem_(nullptr),
imm_(ioptions_.min_write_buffer_number_to_merge,
Expand Down
3 changes: 3 additions & 0 deletions include/rocksdb/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,9 @@ class TableFactory {
// Developers should use DB::SetOption() instead to dynamically change
// options while the DB is open.
virtual void* GetOptions() { return nullptr; }

// Return is delete range supported
virtual bool IsDeleteRangeSupported() const { return false; }
};

#ifndef ROCKSDB_LITE
Expand Down
2 changes: 2 additions & 0 deletions table/block_based_table_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class BlockBasedTableFactory : public TableFactory {

void* GetOptions() override { return &table_options_; }

bool IsDeleteRangeSupported() const override { return true; }

private:
BlockBasedTableOptions table_options_;
};
Expand Down

0 comments on commit 70440f7

Please sign in to comment.