~ubuntu-branches/ubuntu/trusty/leveldb/trusty

« back to all changes in this revision

Viewing changes to db/version_set.h

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2011-11-30 12:06:07 UTC
  • mfrom: (7.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20111130120607-e973e9fkwp0re29b
Tags: 0+20111031.git36a5f8e-2
* Fix build failure with --as-needed flag enabled (Closes: #647105).
* Re-introduce Cristoph Egger's patch to allow compilation
  on kFreeBSD (Closes: #648248).

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
                    const Slice& key);
44
44
 
45
45
// Returns true iff some file in "files" overlaps the user key range
46
 
// [smallest,largest].
 
46
// [*smallest,*largest].
 
47
// smallest==NULL represents a key smaller than all keys in the DB.
 
48
// largest==NULL represents a key largest than all keys in the DB.
 
49
// REQUIRES: If disjoint_sorted_files, files[] contains disjoint ranges
 
50
//           in sorted order.
47
51
extern bool SomeFileOverlapsRange(
48
52
    const InternalKeyComparator& icmp,
 
53
    bool disjoint_sorted_files,
49
54
    const std::vector<FileMetaData*>& files,
50
 
    const Slice& smallest_user_key,
51
 
    const Slice& largest_user_key);
 
55
    const Slice* smallest_user_key,
 
56
    const Slice* largest_user_key);
52
57
 
53
58
class Version {
54
59
 public:
77
82
  void Ref();
78
83
  void Unref();
79
84
 
 
85
  void GetOverlappingInputs(
 
86
      int level,
 
87
      const InternalKey* begin,         // NULL means before all keys
 
88
      const InternalKey* end,           // NULL means after all keys
 
89
      std::vector<FileMetaData*>* inputs);
 
90
 
80
91
  // Returns true iff some file in the specified level overlaps
81
 
  // some part of [smallest_user_key,largest_user_key].
 
92
  // some part of [*smallest_user_key,*largest_user_key].
 
93
  // smallest_user_key==NULL represents a key smaller than all keys in the DB.
 
94
  // largest_user_key==NULL represents a key largest than all keys in the DB.
82
95
  bool OverlapInLevel(int level,
83
 
                      const Slice& smallest_user_key,
84
 
                      const Slice& largest_user_key);
 
96
                      const Slice* smallest_user_key,
 
97
                      const Slice* largest_user_key);
 
98
 
 
99
  // Return the level at which we should place a new memtable compaction
 
100
  // result that covers the range [smallest_user_key,largest_user_key].
 
101
  int PickLevelForMemTableOutput(const Slice& smallest_user_key,
 
102
                                 const Slice& largest_user_key);
85
103
 
86
104
  int NumFiles(int level) const { return files_[level].size(); }
87
105
 
192
210
  // the result.
193
211
  Compaction* CompactRange(
194
212
      int level,
195
 
      const InternalKey& begin,
196
 
      const InternalKey& end);
 
213
      const InternalKey* begin,
 
214
      const InternalKey* end);
197
215
 
198
216
  // Return the maximum overlapping data (in bytes) at next level for any
199
217
  // file at a level >= 1.
232
250
 
233
251
  void Finalize(Version* v);
234
252
 
235
 
  void GetOverlappingInputs(
236
 
      int level,
237
 
      const InternalKey& begin,
238
 
      const InternalKey& end,
239
 
      std::vector<FileMetaData*>* inputs);
240
 
 
241
253
  void GetRange(const std::vector<FileMetaData*>& inputs,
242
254
                InternalKey* smallest,
243
255
                InternalKey* largest);
353
365
  size_t level_ptrs_[config::kNumLevels];
354
366
};
355
367
 
356
 
}
 
368
}  // namespace leveldb
357
369
 
358
370
#endif  // STORAGE_LEVELDB_DB_VERSION_SET_H_