darkchoc/Consistent-Hashing
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
This is a C++ implemention of Consistent Hashing. You need to specify the hash space (an integer between 100 and 10000), the virtualization factor (an integer between 1 and 10) which is basically the number of virtual instances of a node that will be spawned. Finally you need to mention the type of hash function to use (Default, Custom1, Custom2). If you want to create your own hashing functions, please do so in hash_functions.h The hash function for hashing nodes and that for hashing data points is different. You need to implement both in case you plan to create your own custom hash function. Once these inputs have been provided, you can continue to give further commands (mentioned below). Program will exit on being given an empty input. ADD NODE <nodename - only small letters> REMOVE NODE <nodename> ADD DATA <data - only integers> REMOVE DATA <data> PRINT To compile: g++ driver.cpp To run: ./a.out