mdbx-test: add stochastic reverse mode to the append scenario.

Change-Id: If506aff63b6c517922ae621f7805b58c9282e946
This commit is contained in:
Leonid Yuriev
2021-03-27 16:47:08 +03:00
parent 83cd4f7d58
commit 19575e799f
3 changed files with 92 additions and 71 deletions

View File

@@ -128,12 +128,17 @@ public:
void setup(const config::actor_params_pod &actor, unsigned actor_id,
unsigned thread_number);
bool is_unordered() const;
void seek2end(serial_t &serial) const;
bool increment(serial_t &serial, int delta) const;
bool increment_key_part(serial_t &serial, int delta,
bool reset_value_part = true) const {
if (reset_value_part)
serial &= ~((serial_t(1) << mapping.split) - 1);
if (reset_value_part) {
serial_t value_part_bits = ((serial_t(1) << mapping.split) - 1);
serial |= value_part_bits;
if (delta >= 0)
serial &= ~value_part_bits;
}
return increment(serial, delta << mapping.split);
}
};