[RocksDB] [Performance] Allow different posix advice to be applied to the same table file

Summary:
Current posix advice implementation ties up the access pattern hint with the creation of a file.
It is not possible to apply different advice for different access (random get vs compaction read),
without keeping two open files for the same table. This patch extended the RandomeAccessFile interface
to accept new access hint at anytime. Particularly, we are able to set different access hint on the same
table file based on when/how the file is used.
Two options are added to set the access hint, after the file is first opened and after the file is being
compacted.

Test Plan: make check; db_stress; db_bench

Reviewers: dhruba

Reviewed By: dhruba

CC: MarkCallaghan, leveldb

Differential Revision: https://reviews.facebook.net/D10905
This commit is contained in:
Haobo Xu
2013-05-17 15:53:01 -07:00
parent 2df65c118c
commit ab8d2f6ab2
12 changed files with 146 additions and 22 deletions

View File

@@ -27,10 +27,12 @@ extern Iterator* NewTwoLevelIterator(
void* arg,
const ReadOptions& options,
const EnvOptions& soptions,
const Slice& index_value),
const Slice& index_value,
bool for_compaction),
void* arg,
const ReadOptions& options,
const EnvOptions& soptions);
const EnvOptions& soptions,
bool for_compaction = false);
} // namespace leveldb