diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2013-08-24 22:21:41 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2013-08-24 22:21:41 +0200 |
commit | eed29f0f50806b9cfe9653509e7ed7f7eebdd3e3 (patch) | |
tree | b7c699c2c085ef911eca46890093d04644eb96c5 /db/version_set.h | |
parent | 1bb86d6f154da45464eb8b009c298dccd1cb3dab (diff) |
Squashed 'src/leveldb/' changes from be1b0ff..936b461
936b461 Merge upstream LevelDB 1.13.
748539c LevelDB 1.13
git-subtree-dir: src/leveldb
git-subtree-split: 936b4613ea4551992e6096b1e05eeefc09a20e3b
Diffstat (limited to 'db/version_set.h')
-rw-r--r-- | db/version_set.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/db/version_set.h b/db/version_set.h index 9d084fdb7d..20de0e2629 100644 --- a/db/version_set.h +++ b/db/version_set.h @@ -78,6 +78,12 @@ class Version { // REQUIRES: lock is held bool UpdateStats(const GetStats& stats); + // Record a sample of bytes read at the specified internal key. + // Samples are taken approximately once every config::kReadBytesPeriod + // bytes. Returns true if a new compaction may need to be triggered. + // REQUIRES: lock is held + bool RecordReadSample(Slice key); + // Reference count management (so Versions do not disappear out from // under live iterators) void Ref(); @@ -114,6 +120,15 @@ class Version { class LevelFileNumIterator; Iterator* NewConcatenatingIterator(const ReadOptions&, int level) const; + // Call func(arg, level, f) for every file that overlaps user_key in + // order from newest to oldest. If an invocation of func returns + // false, makes no more calls. + // + // REQUIRES: user portion of internal_key == user_key. + void ForEachOverlapping(Slice user_key, Slice internal_key, + void* arg, + bool (*func)(void*, int, FileMetaData*)); + VersionSet* vset_; // VersionSet to which this Version belongs Version* next_; // Next version in linked list Version* prev_; // Previous version in linked list |