Class DefaultConsistentHashFactory.Builder
- java.lang.Object
-
- org.infinispan.distribution.ch.impl.DefaultConsistentHashFactory.Builder
-
- Enclosing class:
- DefaultConsistentHashFactory
protected static class DefaultConsistentHashFactory.Builder extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Address,Float>capacityFactorsprotected List<Address>membersprotected intmodCountprotected OwnershipStatisticsstats
-
Constructor Summary
Constructors Constructor Description Builder(int numOwners, int numSegments, List<Address> members, Map<Address,Float> capacityFactors)Builder(DefaultConsistentHash baseCH)Builder(DefaultConsistentHashFactory.Builder other)Builder(DefaultConsistentHash baseCH, List<Address> actualMembers, Map<Address,Float> actualCapacityFactors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddOwner(int segment, Address owner)booleanaddOwners(int segment, Collection<Address> newOwners)voidaddPrimaryOwner(int segment, Address newPrimaryOwner)DefaultConsistentHashbuild()intcomputeActualNumOwners(int numOwners, List<Address> members, Map<Address,Float> capacityFactors)intgetActualNumOwners()List<Address>getBackupOwners(int segment)floatgetCapacityFactor(Address node)Map<Address,Float>getCapacityFactors()List<Address>getMembers()intgetNumNodes()intgetNumSegments()intgetOwned(Address node)List<Address>getOwners(int segment)intgetPrimaryOwned(Address node)AddressgetPrimaryOwner(int segment)booleanremoveOwner(int segment, Address owner)voidreplacePrimaryOwnerWithBackup(int segment, Address newPrimaryOwner)
-
-
-
Constructor Detail
-
Builder
public Builder(int numOwners, int numSegments, List<Address> members, Map<Address,Float> capacityFactors)
-
Builder
public Builder(DefaultConsistentHash baseCH, List<Address> actualMembers, Map<Address,Float> actualCapacityFactors)
-
Builder
public Builder(DefaultConsistentHash baseCH)
-
Builder
public Builder(DefaultConsistentHashFactory.Builder other)
-
-
Method Detail
-
getActualNumOwners
public int getActualNumOwners()
-
getNumSegments
public int getNumSegments()
-
getPrimaryOwner
public Address getPrimaryOwner(int segment)
-
addOwner
public boolean addOwner(int segment, Address owner)
-
addOwners
public boolean addOwners(int segment, Collection<Address> newOwners)
-
removeOwner
public boolean removeOwner(int segment, Address owner)
-
addPrimaryOwner
public void addPrimaryOwner(int segment, Address newPrimaryOwner)
-
replacePrimaryOwnerWithBackup
public void replacePrimaryOwnerWithBackup(int segment, Address newPrimaryOwner)
-
build
public DefaultConsistentHash build()
-
getPrimaryOwned
public int getPrimaryOwned(Address node)
-
getOwned
public int getOwned(Address node)
-
computeActualNumOwners
public int computeActualNumOwners(int numOwners, List<Address> members, Map<Address,Float> capacityFactors)
-
getNumNodes
public int getNumNodes()
-
getCapacityFactor
public float getCapacityFactor(Address node)
-
-