Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add city hash as default hash function for balancer states #142

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yevzman
Copy link

@yevzman yevzman commented Mar 25, 2024

No description provided.

@yevzman yevzman requested a review from taitov as a code owner March 25, 2024 18:53
@yevzman yevzman changed the title Add city hash Add city hash as default hash function for balancer states Mar 25, 2024
@@ -2389,7 +2396,7 @@ class hashtable_mod_spinlock
template<typename key_t,
typename value_t,
uint32_t chunk_size,
hash_function_t<key_t> calculate_hash = calculate_hash_crc<key_t>>
hash_function_t<key_t> calculate_hash = calculate_hash_city<key_t>>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let us start with balancer sessions table only

@yevzman yevzman force-pushed the add-city-hash branch 2 times, most recently from 30bbc23 to 0e36f44 Compare March 26, 2024 13:55
template<typename key_t>
inline uint32_t calculate_hash_city(const key_t& key)
{
return CityHash32((char*)&key, sizeof(key));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reinterpret_cast<const char*>(&key)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants