MCPcopy Create free account
hub / github.com/baidu/tera / PackTimestampAndType

Function PackTimestampAndType

src/io/coding.h:80–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78enum UserKeyType { UKT_VALUE = 0, UKT_FORSEEK };
79
80inline uint64_t PackTimestampAndType(int64_t timestamp, UserKeyType key_type) {
81 uint64_t stamp = 0;
82 if (timestamp >= 0) {
83 stamp = static_cast<uint64_t>(timestamp);
84 }
85 return (stamp << sizeof(UserKeyType)) | key_type;
86}
87
88bool ParseKeySlice(const leveldb::Slice& key, int64_t* timestamp, UserKeyType* type,
89 leveldb::Slice* short_key, leveldb::Slice* time_key);

Callers 3

FindShortestSeparatorMethod · 0.85
FindShortSuccessorMethod · 0.85
PackUserKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected