mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 19:24:14 +08:00
mdbx-test: seeding keygen with actor_id for better spreading.
This commit is contained in:
parent
01ae5bad7d
commit
844e39ebef
@ -53,7 +53,7 @@ bool testcase_hill::run() {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* TODO: работа в несколько потоков */
|
/* TODO: работа в несколько потоков */
|
||||||
keyvalue_maker.setup(config.params, 0 /* thread_number */);
|
keyvalue_maker.setup(config.params, config.actor_id, 0 /* thread_number */);
|
||||||
|
|
||||||
keygen::buffer a_key = keygen::alloc(config.params.keylen_max);
|
keygen::buffer a_key = keygen::alloc(config.params.keylen_max);
|
||||||
keygen::buffer a_data_0 = keygen::alloc(config.params.datalen_max);
|
keygen::buffer a_data_0 = keygen::alloc(config.params.datalen_max);
|
||||||
|
@ -142,7 +142,7 @@ void __hot maker::pair(serial_t serial, const buffer &key, buffer &value,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void maker::setup(const config::actor_params_pod &actor,
|
void maker::setup(const config::actor_params_pod &actor, unsigned actor_id,
|
||||||
unsigned thread_number) {
|
unsigned thread_number) {
|
||||||
key_essentials.flags =
|
key_essentials.flags =
|
||||||
actor.table_flags & (MDBX_INTEGERKEY | MDBX_REVERSEKEY | MDBX_DUPSORT);
|
actor.table_flags & (MDBX_INTEGERKEY | MDBX_REVERSEKEY | MDBX_DUPSORT);
|
||||||
@ -161,7 +161,7 @@ void maker::setup(const config::actor_params_pod &actor,
|
|||||||
assert(thread_number < 2);
|
assert(thread_number < 2);
|
||||||
(void)thread_number;
|
(void)thread_number;
|
||||||
mapping = actor.keygen;
|
mapping = actor.keygen;
|
||||||
salt = actor.keygen.seed * UINT64_C(14653293970879851569);
|
salt = (actor.keygen.seed + actor_id) * UINT64_C(14653293970879851569);
|
||||||
|
|
||||||
// FIXME: TODO
|
// FIXME: TODO
|
||||||
base = 0;
|
base = 0;
|
||||||
|
@ -119,7 +119,8 @@ public:
|
|||||||
|
|
||||||
void pair(serial_t serial, const buffer &key, buffer &value,
|
void pair(serial_t serial, const buffer &key, buffer &value,
|
||||||
serial_t value_age);
|
serial_t value_age);
|
||||||
void setup(const config::actor_params_pod &actor, unsigned thread_number);
|
void setup(const config::actor_params_pod &actor, unsigned actor_id,
|
||||||
|
unsigned thread_number);
|
||||||
|
|
||||||
bool increment(serial_t &serial, int delta);
|
bool increment(serial_t &serial, int delta);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user