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 voidThe capacity factor of each member.getMemberIndexMap(List<Address> members) 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 org.infinispan.distribution.ch.impl.PersistedMembersparseMembers(ScopedPersistentState state, Function<UUID, Address> addressMapper) protected static intvoidtoScopedState(ScopedPersistentState state, Function<Address, UUID> addressMapper) Writes thisConsistentHashto the specified scoped persistent state.protected static voidwriteAddressToState(ScopedPersistentState state, List<Address> members, String sizeKey, String memberKeyFormat, Function<Address, UUID> addressMapper) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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:ConsistentHashWrites thisConsistentHashto the specified scoped persistent state.- Specified by:
toScopedStatein interfaceConsistentHash- Parameters:
state- The state to which thisConsistentHashwill be written.addressMapper- The mapperFunctionto convert theAddressto theUUIDused to persist the address within the state.
-
getMembers
Description copied from interface:ConsistentHashShould return the addresses of the nodes used to create this consistent hash.- Specified by:
getMembersin interfaceConsistentHash- Returns:
- list of node addresses.
-
mergeLists
-
getMemberIndexMap
-
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
-
writeAddressToState
-