diff options
author | David Grogan <dgrogan@chromium.org> | 2013-08-21 11:12:47 -0700 |
---|---|---|
committer | David Grogan <dgrogan@chromium.org> | 2013-08-21 11:12:47 -0700 |
commit | 748539c183453bdeaff1eb0da8ccf5adacb796e7 (patch) | |
tree | 6a1712798e5cc172b79e1113d9c1a0fc93496fa7 /db/version_set.h | |
parent | 5bd76dc10d840df23255ba0e635083a2a94e0461 (diff) | |
download | leveldb-748539c183453bdeaff1eb0da8ccf5adacb796e7.tar.gz |
LevelDB 1.13v1.13
Fix issues 77, 87, 182, 190.
Additionally, fix the bug described in
https://groups.google.com/d/msg/leveldb/yL6h1mAOc20/vLU64RylIdMJ
where a large contiguous keyspace of deleted data was not getting
compacted.
Also fix a bug where options.max_open_files was not getting clamped
properly.
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 9d084fd..20de0e2 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 |