diff options
author | AlexSm <alex@ydb.tech> | 2024-01-04 15:09:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-04 15:09:05 +0100 |
commit | dab291146f6cd7d35684e3a1150e5bb1c412982c (patch) | |
tree | 36ef35f6cacb6432845a4a33f940c95871036b32 /library/cpp/consistent_hashing/consistent_hashing.h | |
parent | 63660ad5e7512029fd0218e7a636580695a24e1f (diff) | |
download | ydb-dab291146f6cd7d35684e3a1150e5bb1c412982c.tar.gz |
Library import 5, delete go dependencies (#832)
* Library import 5, delete go dependencies
* Fix yt client
Diffstat (limited to 'library/cpp/consistent_hashing/consistent_hashing.h')
-rw-r--r-- | library/cpp/consistent_hashing/consistent_hashing.h | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/library/cpp/consistent_hashing/consistent_hashing.h b/library/cpp/consistent_hashing/consistent_hashing.h deleted file mode 100644 index 8e4d2991501..00000000000 --- a/library/cpp/consistent_hashing/consistent_hashing.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include <util/system/defaults.h> - -/* - * Maps random ui64 x (in fact hash of some string) to n baskets/shards. - * Output value is id of a basket. 0 <= ConsistentHashing(x, n) < n. - * Probability of all baskets must be equal. Also, it should be consistent - * in terms, that with different n_1 < n_2 probability of - * ConsistentHashing(x, n_1) != ConsistentHashing(x, n_2) must be equal to - * (n_2 - n_1) / n_2 - the least possible with previous conditions. - * It requires O(1) memory and cpu to calculate. So, it is faster than classic - * consistent hashing algos with points on circle. - */ -size_t ConsistentHashing(ui64 x, size_t n); // Works good for n < 65536 -size_t ConsistentHashing(ui64 lo, ui64 hi, size_t n); // Works good for n < 4294967296 |