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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
The capacity factor of each member.getMemberIndexMap
(List<Address> members) 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 org.infinispan.distribution.ch.impl.PersistedMembers
parseMembers
(ScopedPersistentState state, Function<UUID, Address> addressMapper) protected static int
void
toScopedState
(ScopedPersistentState state, Function<Address, UUID> addressMapper) Writes thisConsistentHash
to the specified scoped persistent state.protected static void
writeAddressToState
(ScopedPersistentState state, List<Address> members, String sizeKey, String memberKeyFormat, Function<Address, UUID> addressMapper) 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
-
Field Details
-
STATE_CAPACITY_FACTOR
- See Also:
-
STATE_CAPACITY_FACTORS
- See Also:
-
STATE_NUM_SEGMENTS
- See Also:
-
members
-
capacityFactors
-
-
Constructor Details
-
AbstractConsistentHash
-
AbstractConsistentHash
-
-
Method Details
-
parseNumSegments
-
parseMembers
protected static org.infinispan.distribution.ch.impl.PersistedMembers parseMembers(ScopedPersistentState state, Function<UUID, Address> addressMapper) -
toScopedState
Description copied from interface:ConsistentHash
Writes thisConsistentHash
to the specified scoped persistent state.- Specified by:
toScopedState
in interfaceConsistentHash
- Parameters:
state
- The state to which thisConsistentHash
will be written.addressMapper
- The mapperFunction
to convert theAddress
to theUUID
used to persist the address within the state.
-
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:
- list of node addresses.
-
mergeLists
-
getMemberIndexMap
-
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
-
writeAddressToState
-