Package io.fluxcapacitor.common
Class ConsistentHashing
java.lang.Object
io.fluxcapacitor.common.ConsistentHashing
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcomputeSegment(String routingKey) static intcomputeSegment(String routingKey, int maxSegments) static intcomputeSegment(String routingKey, Function<String, Integer> hashFunction, int maxSegments) static booleanfallsInRange(int segment, int[] segmentRange) static booleanfallsInRange(String routingKey, int[] segmentRange) static booleanfallsInRange(String routingKey, int[] segmentRange, int maxSegments) static booleanisEmptyRange(int[] segmentRange)
-
Constructor Details
-
ConsistentHashing
public ConsistentHashing()
-
-
Method Details
-
computeSegment
-
computeSegment
-
computeSegment
-
fallsInRange
-
fallsInRange
-
fallsInRange
public static boolean fallsInRange(int segment, int[] segmentRange) -
isEmptyRange
public static boolean isEmptyRange(int[] segmentRange)
-