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>
capacityFactors
protected org.infinispan.commons.hash.Hash
hashFunction
protected List<Address>
members
protected OwnershipStatistics
stats
-
Constructor Summary
Constructors Constructor Description Builder(org.infinispan.commons.hash.Hash hashFunction, 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 boolean
addOwner(int segment, Address owner)
boolean
addOwners(int segment, Collection<Address> newOwners)
void
addPrimaryOwner(int segment, Address newPrimaryOwner)
DefaultConsistentHash
build()
int
computeActualNumOwners(int numOwners, List<Address> members, Map<Address,Float> capacityFactors)
int
getActualNumOwners()
List<Address>
getBackupOwners(int segment)
float
getCapacityFactor(Address node)
Map<Address,Float>
getCapacityFactors()
List<Address>
getMembers()
int
getNumNodes()
int
getNumSegments()
int
getOwned(Address node)
float
getOwnedPerCapacity(Address node)
List<Address>
getOwners(int segment)
int
getPrimaryOwned(Address node)
float
getPrimaryOwnedPerCapacity(Address node)
Address
getPrimaryOwner(int segment)
float
getTotalCapacity()
boolean
removeOwner(int segment, Address owner)
void
replacePrimaryOwnerWithBackup(int segment, Address newPrimaryOwner)
-
-
-
Constructor Detail
-
Builder
public Builder(org.infinispan.commons.hash.Hash hashFunction, 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)
-
getPrimaryOwnedPerCapacity
public float getPrimaryOwnedPerCapacity(Address node)
-
getOwnedPerCapacity
public float getOwnedPerCapacity(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)
-
getTotalCapacity
public float getTotalCapacity()
-
-