Class AbstractConsistentHash
java.lang.Object
org.infinispan.distribution.ch.impl.AbstractConsistentHash
- All Implemented Interfaces:
ConsistentHash
- Direct Known Subclasses:
DefaultConsistentHash
- Author:
- Radim Vansa <rvansa@redhat.com>
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractConsistentHash
(int numSegments, List<Address> members, float[] capacityFactors) protected
protected
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
The capacity factor of each member.Should return the addresses of the nodes used to create this consistent hash.protected static void
mergeLists
(List<Address> dest, List<Address> src) Adds all elements fromsrc
list that do not already exist indest
list to the latter.protected static float[]
protected static Hash
protected static int
remapCapacityFactors
(UnaryOperator<Address> remapper, boolean allowMissing) remapMembers
(UnaryOperator<Address> remapper, boolean allowMissing) void
Writes this ConsistentHash to the specified scoped state.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:ConsistentHash
Writes this ConsistentHash to the specified scoped state. Before invoking this method, the ConsistentHash addresses will have to be replaced with their correspondingPersistentUUID
s- Specified by:
toScopedState
in interfaceConsistentHash
- Parameters:
state
- the state to which this ConsistentHash will be written
-
getMembers
Description copied from interface:ConsistentHash
Should return the addresses of the nodes used to create this consistent hash.- Specified by:
getMembers
in interfaceConsistentHash
- Returns:
- set of node addresses.
-
mergeLists
Adds all elements fromsrc
list that do not already exist indest
list to the latter.- Parameters:
dest
- List where elements are addedsrc
- List of elements to add - this is never modified
-
getCapacityFactors
Description copied from interface:ConsistentHash
The 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:
getCapacityFactors
in interfaceConsistentHash
-
unionCapacityFactors
-
checkSameHashAndSegments
-
remapCapacityFactors
protected Map<Address,Float> remapCapacityFactors(UnaryOperator<Address> remapper, boolean allowMissing) -
remapMembers
-