Skip to content

Commit

Permalink
re-enable BlockBasedTable::SetupForCompaction()
Browse files Browse the repository at this point in the history
Summary:
It was commented out in D22545 by accident. Keep the option in
ImmutableOptions for now. I can make it dynamic in
https://reviews.facebook.net/D23349

Test Plan: make release

Reviewers: sdong, yhchiang, igor

Reviewed By: igor

Subscribers: leveldb

Differential Revision: https://reviews.facebook.net/D23865
  • Loading branch information
Lei Jin committed Sep 23, 2014
1 parent 55af370 commit 0a29ce5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions include/rocksdb/immutable_options.h
Expand Up @@ -77,6 +77,8 @@ struct ImmutableCFOptions {
std::vector<CompressionType> compression_per_level;

CompressionOptions compression_opts;

Options::AccessHint access_hint_on_compaction_start;
};

} // namespace rocksdb
14 changes: 8 additions & 6 deletions include/rocksdb/options.h
Expand Up @@ -58,6 +58,7 @@ enum CompactionStyle : char {
kCompactionStyleFIFO = 0x2, // FIFO compaction style
};


struct CompactionOptionsFIFO {
// once the total sum of table files reaches this, we will delete the oldest
// table file
Expand Down Expand Up @@ -783,12 +784,13 @@ struct DBOptions {
// Specify the file access pattern once a compaction is started.
// It will be applied to all input files of a compaction.
// Default: NORMAL
enum {
NONE,
NORMAL,
SEQUENTIAL,
WILLNEED
} access_hint_on_compaction_start;
enum AccessHint {
NONE,
NORMAL,
SEQUENTIAL,
WILLNEED
};
AccessHint access_hint_on_compaction_start;

// Use adaptive mutex, which spins in the user space before resorting
// to kernel. This could reduce context switch when the mutex is not
Expand Down
4 changes: 1 addition & 3 deletions table/block_based_table_reader.cc
Expand Up @@ -532,8 +532,7 @@ Status BlockBasedTable::Open(const ImmutableCFOptions& ioptions,
}

void BlockBasedTable::SetupForCompaction() {
/*
switch (.access_hint_on_compaction_start) {
switch (rep_->ioptions.access_hint_on_compaction_start) {
case Options::NONE:
break;
case Options::NORMAL:
Expand All @@ -549,7 +548,6 @@ void BlockBasedTable::SetupForCompaction() {
assert(false);
}
compaction_optimized_ = true;
*/
}

std::shared_ptr<const TableProperties> BlockBasedTable::GetTableProperties()
Expand Down
3 changes: 2 additions & 1 deletion util/options.cc
Expand Up @@ -59,7 +59,8 @@ ImmutableCFOptions::ImmutableCFOptions(const Options& options)
use_fsync(options.use_fsync),
compression(options.compression),
compression_per_level(options.compression_per_level),
compression_opts(options.compression_opts) {}
compression_opts(options.compression_opts),
access_hint_on_compaction_start(options.access_hint_on_compaction_start) {}

ColumnFamilyOptions::ColumnFamilyOptions()
: comparator(BytewiseComparator()),
Expand Down

0 comments on commit 0a29ce5

Please sign in to comment.