Class AbstractConsistentHash
java.lang.Object
org.infinispan.distribution.ch.impl.AbstractConsistentHash
- All Implemented Interfaces:
ConsistentHash
- Direct Known Subclasses:
DefaultConsistentHash,ScatteredConsistentHash
- Author:
- Radim Vansa <rvansa@redhat.com>
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractConsistentHash(int numSegments, List<Address> members, float[] capacityFactors) protectedprotected -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThe capacity factor of each member.Should return the addresses of the nodes used to create this consistent hash.protected static voidmergeLists(List<Address> dest, List<Address> src) Adds all elements fromsrclist that do not already exist indestlist to the latter.protected static float[]protected static Hashprotected static intremapCapacityFactors(UnaryOperator<Address> remapper, boolean allowMissing) remapMembers(UnaryOperator<Address> remapper, boolean allowMissing) voidWrites this ConsistentHash to the specified scoped state.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.distribution.ch.ConsistentHash
getNumSegments, getPrimarySegmentsForOwner, getRoutingTableAsString, getSegmentsForOwner, isReplicated, isSegmentLocalToNode, locateOwnersForSegment, locatePrimaryOwnerForSegment, remapAddresses, remapAddressRemoveMissing
-
Field Details
-
STATE_CAPACITY_FACTOR
- See Also:
-
STATE_CAPACITY_FACTORS
- See Also:
-
STATE_NUM_SEGMENTS
- See Also:
-
members
The membership of the cache topology that uses this CH. -
capacityFactors
protected final float[] capacityFactors
-
-
Constructor Details
-
AbstractConsistentHash
-
AbstractConsistentHash
-
AbstractConsistentHash
-
-
Method Details
-
parseNumSegments
-
parseMembers
-
parseHashFunction
-
parseCapacityFactors
-
toScopedState
Description copied from interface:ConsistentHashWrites this ConsistentHash to the specified scoped state. Before invoking this method, the ConsistentHash addresses will have to be replaced with their correspondingPersistentUUIDs- Specified by:
toScopedStatein interfaceConsistentHash- Parameters:
state- the state to which this ConsistentHash will be written
-
getMembers
Description copied from interface:ConsistentHashShould return the addresses of the nodes used to create this consistent hash.- Specified by:
getMembersin interfaceConsistentHash- Returns:
- set of node addresses.
-
mergeLists
Adds all elements fromsrclist that do not already exist indestlist to the latter.- Parameters:
dest- List where elements are addedsrc- List of elements to add - this is never modified
-
getCapacityFactors
Description copied from interface:ConsistentHashThe capacity factor of each member. Determines the relative capacity of each node compared to the others. Ifnull, all the members are assumed to have a capacity factor of 1.- Specified by:
getCapacityFactorsin interfaceConsistentHash
-
unionCapacityFactors
-
checkSameHashAndSegments
-
remapCapacityFactors
protected Map<Address,Float> remapCapacityFactors(UnaryOperator<Address> remapper, boolean allowMissing) -
remapMembers
-