MCPcopy Create free account
hub / github.com/ElementsProject/elements / InternalKeyComparator

Class InternalKeyComparator

src/leveldb/db/dbformat.h:102–117  ·  view source on GitHub ↗

A comparator for internal keys that uses a specified comparator for the user key portion and breaks ties by decreasing sequence number.

Source from the content-addressed store, hash-verified

100// A comparator for internal keys that uses a specified comparator for
101// the user key portion and breaks ties by decreasing sequence number.
102class InternalKeyComparator : public Comparator {
103 private:
104 const Comparator* user_comparator_;
105
106 public:
107 explicit InternalKeyComparator(const Comparator* c) : user_comparator_(c) {}
108 const char* Name() const override;
109 int Compare(const Slice& a, const Slice& b) const override;
110 void FindShortestSeparator(std::string* start,
111 const Slice& limit) const override;
112 void FindShortSuccessor(std::string* key) const override;
113
114 const Comparator* user_comparator() const { return user_comparator_; }
115
116 int Compare(const InternalKey& a, const InternalKey& b) const;
117};
118
119// Filter policy wrapper that converts from internal keys to user keys
120class InternalFilterPolicy : public FilterPolicy {

Callers 2

ShortenFunction · 0.70
ShortSuccessorFunction · 0.70

Calls

no outgoing calls

Tested by 2

ShortenFunction · 0.56
ShortSuccessorFunction · 0.56