This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.SortedMap; | |
import java.util.TreeMap; | |
public class ConsistentHashing { | |
// Consistent Hashing with Ring having 50 buckets. | |
final static int LIMIT = 50; | |
// Sorted Map. | |
final static SortedMap<Integer, String> bucketIdToServer = new TreeMap<>(); |