mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
[Performance Branch] PlainTable to encode rows with seqID 0, value type using 1 internal byte.
Summary: In PlainTable, use one single byte to represent 8 bytes of internal bytes, if seqID = 0 and it is value type (which should be common for bottom most files). It is to save 7 bytes for uncompressed cases. Test Plan: make all check Reviewers: haobo, dhruba, kailiu Reviewed By: haobo CC: igor, leveldb Differential Revision: https://reviews.facebook.net/D15489
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "db/dbformat.h"
|
||||
#include "rocksdb/env.h"
|
||||
#include "rocksdb/slice.h"
|
||||
#include "util/random.h"
|
||||
@@ -51,5 +53,28 @@ class ErrorEnv : public EnvWrapper {
|
||||
}
|
||||
};
|
||||
|
||||
// An internal comparator that just forward comparing results from the
|
||||
// user comparator in it. Can be used to test entities that have no dependency
|
||||
// on internal key structure but consumes InternalKeyComparator, like
|
||||
// BlockBasedTable.
|
||||
class PlainInternalKeyComparator : public InternalKeyComparator {
|
||||
public:
|
||||
explicit PlainInternalKeyComparator(const Comparator* c)
|
||||
: InternalKeyComparator(c) {}
|
||||
|
||||
virtual ~PlainInternalKeyComparator() {}
|
||||
|
||||
virtual int Compare(const Slice& a, const Slice& b) const override {
|
||||
return user_comparator()->Compare(a, b);
|
||||
}
|
||||
virtual void FindShortestSeparator(std::string* start,
|
||||
const Slice& limit) const override {
|
||||
user_comparator()->FindShortestSeparator(start, limit);
|
||||
}
|
||||
virtual void FindShortSuccessor(std::string* key) const override {
|
||||
user_comparator()->FindShortSuccessor(key);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace test
|
||||
} // namespace rocksdb
|
||||
|
||||
Reference in New Issue
Block a user