aboutsummaryrefslogtreecommitdiff
path: root/src/leveldb/db/version_set.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2013-08-24 22:21:41 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2013-08-24 22:21:41 +0200
commit877b5e3653f12882e12c75aa0bb5be47f847bd09 (patch)
tree399b43ec4298fdefe16fd9c33e684b3e58867755 /src/leveldb/db/version_set.h
parente9e2ef5fbd610fbaa3801440254c39ac4ba8f91d (diff)
parenteed29f0f50806b9cfe9653509e7ed7f7eebdd3e3 (diff)
Merge src/leveldb changes for LevelDB 1.13
Diffstat (limited to 'src/leveldb/db/version_set.h')
-rw-r--r--src/leveldb/db/version_set.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/leveldb/db/version_set.h b/src/leveldb/db/version_set.h
index 9d084fdb7d..20de0e2629 100644
--- a/src/leveldb/db/version_set.h
+++ b/src/leveldb/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