mirror of https://gitee.com/bigwinds/arangodb
change rocksdbkey for geoindex
This commit is contained in:
parent
81a5a39e22
commit
13f2cd4cb9
|
@ -306,15 +306,16 @@ RocksDBKey::RocksDBKey(RocksDBEntryType type, uint64_t first,
|
|||
}
|
||||
}
|
||||
|
||||
RocksDBKey::RocksDBKey(RocksDBEntryType type, bool isSlot, uint64_t offset)
|
||||
RocksDBKey::RocksDBKey(RocksDBEntryType type, uint64_t objectId, uint64_t offset, bool isSlot)
|
||||
: _type(type), _buffer() {
|
||||
switch (_type) {
|
||||
case RocksDBEntryType::GeoIndexValue: {
|
||||
|
||||
size_t length = sizeof(char) + sizeof(isSlot) + sizeof(offset);
|
||||
size_t length = sizeof(char) + sizeof(objectId) + sizeof(offset);
|
||||
_buffer.reserve(length);
|
||||
_buffer.push_back(static_cast<char>(_type));
|
||||
_buffer.append(isSlot, sizeof(isSlot));
|
||||
offset |= std::uint64_t{isSlot} << 63; //encode slot|pot in highest bit
|
||||
uint64ToPersistent(_buffer, objectId);
|
||||
uint64ToPersistent(_buffer, offset);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -240,7 +240,7 @@ class RocksDBKey {
|
|||
std::string const& third);
|
||||
RocksDBKey(RocksDBEntryType type, uint64_t first, arangodb::StringRef const& second,
|
||||
arangodb::StringRef const& third);
|
||||
RocksDBKey(RocksDBEntryType type, bool, uint64_t);
|
||||
RocksDBKey(RocksDBEntryType type, uint64_t objectId, uint64_t index, bool isSlot);
|
||||
|
||||
private:
|
||||
static RocksDBEntryType type(char const* data, size_t size);
|
||||
|
|
Loading…
Reference in New Issue