re-enable BlockBasedTable::SetupForCompaction()

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
main
Lei Jin 10 years ago
parent 55af370756
commit 0a29ce5393
  1. 2
      include/rocksdb/immutable_options.h
  2. 14
      include/rocksdb/options.h
  3. 4
      table/block_based_table_reader.cc
  4. 3
      util/options.cc

@ -77,6 +77,8 @@ struct ImmutableCFOptions {
std::vector<CompressionType> compression_per_level; std::vector<CompressionType> compression_per_level;
CompressionOptions compression_opts; CompressionOptions compression_opts;
Options::AccessHint access_hint_on_compaction_start;
}; };
} // namespace rocksdb } // namespace rocksdb

@ -58,6 +58,7 @@ enum CompactionStyle : char {
kCompactionStyleFIFO = 0x2, // FIFO compaction style kCompactionStyleFIFO = 0x2, // FIFO compaction style
}; };
struct CompactionOptionsFIFO { struct CompactionOptionsFIFO {
// once the total sum of table files reaches this, we will delete the oldest // once the total sum of table files reaches this, we will delete the oldest
// table file // table file
@ -783,12 +784,13 @@ struct DBOptions {
// Specify the file access pattern once a compaction is started. // Specify the file access pattern once a compaction is started.
// It will be applied to all input files of a compaction. // It will be applied to all input files of a compaction.
// Default: NORMAL // Default: NORMAL
enum { enum AccessHint {
NONE, NONE,
NORMAL, NORMAL,
SEQUENTIAL, SEQUENTIAL,
WILLNEED WILLNEED
} access_hint_on_compaction_start; };
AccessHint access_hint_on_compaction_start;
// Use adaptive mutex, which spins in the user space before resorting // Use adaptive mutex, which spins in the user space before resorting
// to kernel. This could reduce context switch when the mutex is not // to kernel. This could reduce context switch when the mutex is not

@ -532,8 +532,7 @@ Status BlockBasedTable::Open(const ImmutableCFOptions& ioptions,
} }
void BlockBasedTable::SetupForCompaction() { void BlockBasedTable::SetupForCompaction() {
/* switch (rep_->ioptions.access_hint_on_compaction_start) {
switch (.access_hint_on_compaction_start) {
case Options::NONE: case Options::NONE:
break; break;
case Options::NORMAL: case Options::NORMAL:
@ -549,7 +548,6 @@ void BlockBasedTable::SetupForCompaction() {
assert(false); assert(false);
} }
compaction_optimized_ = true; compaction_optimized_ = true;
*/
} }
std::shared_ptr<const TableProperties> BlockBasedTable::GetTableProperties() std::shared_ptr<const TableProperties> BlockBasedTable::GetTableProperties()

@ -59,7 +59,8 @@ ImmutableCFOptions::ImmutableCFOptions(const Options& options)
use_fsync(options.use_fsync), use_fsync(options.use_fsync),
compression(options.compression), compression(options.compression),
compression_per_level(options.compression_per_level), 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() ColumnFamilyOptions::ColumnFamilyOptions()
: comparator(BytewiseComparator()), : comparator(BytewiseComparator()),

Loading…
Cancel
Save