Skip to content

darkchoc/Consistent-Hashing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

C++ implementation of consistent hashing, complete with virtualization and feature for addition/deletion of nodes and data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages