Class ScatteredConsistentHashFactory.Builder
- java.lang.Object
-
- org.infinispan.distribution.ch.impl.ScatteredConsistentHashFactory.Builder
-
- Enclosing class:
- ScatteredConsistentHashFactory
protected static class ScatteredConsistentHashFactory.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 int
modCount
protected OwnershipStatistics
stats
-
Constructor Summary
Constructors Constructor Description Builder(org.infinispan.commons.hash.Hash hashFunction, int numSegments, List<Address> members, Map<Address,Float> capacityFactors)
Builder(ScatteredConsistentHash baseCH)
Builder(ScatteredConsistentHashFactory.Builder other)
Builder(ScatteredConsistentHash baseCH, List<Address> actualMembers, Map<Address,Float> actualCapacityFactors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPrimaryOwner(int segment, Address newPrimaryOwner)
ScatteredConsistentHash
build()
float
getCapacityFactor(Address node)
Map<Address,Float>
getCapacityFactors()
List<Address>
getMembers()
int
getNumNodes()
int
getNumSegments()
int
getOwned(Address node)
int
getPrimaryOwned(Address node)
Address
getPrimaryOwner(int segment)
float
getTotalCapacity()
void
setRebalanced(boolean isRebalanced)
-
-
-
Constructor Detail
-
Builder
public Builder(org.infinispan.commons.hash.Hash hashFunction, int numSegments, List<Address> members, Map<Address,Float> capacityFactors)
-
Builder
public Builder(ScatteredConsistentHash baseCH, List<Address> actualMembers, Map<Address,Float> actualCapacityFactors)
-
Builder
public Builder(ScatteredConsistentHash baseCH)
-
Builder
public Builder(ScatteredConsistentHashFactory.Builder other)
-
-
Method Detail
-
getNumSegments
public int getNumSegments()
-
getPrimaryOwner
public Address getPrimaryOwner(int segment)
-
addPrimaryOwner
public void addPrimaryOwner(int segment, Address newPrimaryOwner)
-
build
public ScatteredConsistentHash build()
-
setRebalanced
public void setRebalanced(boolean isRebalanced)
-
getPrimaryOwned
public int getPrimaryOwned(Address node)
-
getOwned
public int getOwned(Address node)
-
getNumNodes
public int getNumNodes()
-
getCapacityFactor
public float getCapacityFactor(Address node)
-
getTotalCapacity
public float getTotalCapacity()
-
-