Implement PEXPIREAT and tune expire dictionary

This commit is contained in:
Roman Gershman 2022-03-12 21:51:35 +02:00
parent 81ffb189ef
commit cceb0d90ca
16 changed files with 166 additions and 44 deletions

View file

@ -92,6 +92,15 @@ class DbSlice {
now_ms_ = now_ms;
}
void UpdateExpireBase(uint64_t now, unsigned generation) {
expire_base_[generation & 1] = now;
}
uint64_t expire_base() const {
return expire_base_[0];
}
// returns wall clock in millis as it has been set via UpdateExpireClock.
uint64_t Now() const {
return now_ms_;
@ -212,6 +221,8 @@ class DbSlice {
EngineShard* owner_;
uint64_t now_ms_ = 0; // Used for expire logic, represents a real clock.
uint64_t expire_base_[2]; // Used for expire logic, represents a real clock.
uint64_t version_ = 1; // Used to version entries in the PrimeTable.
mutable SliceEvents events_; // we may change this even for const operations.