protected static class DefaultConsistentHashFactory.Builder extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<Address,Float> |
capacityFactors |
protected List<Address> |
members |
protected int |
modCount |
protected OwnershipStatistics |
stats |
Constructor and Description |
---|
Builder(DefaultConsistentHash baseCH) |
Builder(DefaultConsistentHashFactory.Builder other) |
Builder(DefaultConsistentHash baseCH,
List<Address> actualMembers,
Map<Address,Float> actualCapacityFactors) |
Builder(int numOwners,
int numSegments,
List<Address> members,
Map<Address,Float> capacityFactors) |
Modifier and Type | Method and 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) |
List<Address> |
getOwners(int segment) |
int |
getPrimaryOwned(Address node) |
Address |
getPrimaryOwner(int segment) |
boolean |
removeOwner(int segment,
Address owner) |
void |
replacePrimaryOwnerWithBackup(int segment,
Address newPrimaryOwner) |
protected final OwnershipStatistics stats
protected int modCount
public Builder(int numOwners, int numSegments, List<Address> members, Map<Address,Float> capacityFactors)
public Builder(DefaultConsistentHash baseCH, List<Address> actualMembers, Map<Address,Float> actualCapacityFactors)
public Builder(DefaultConsistentHash baseCH)
public Builder(DefaultConsistentHashFactory.Builder other)
public int getActualNumOwners()
public int getNumSegments()
public Address getPrimaryOwner(int segment)
public boolean addOwner(int segment, Address owner)
public boolean addOwners(int segment, Collection<Address> newOwners)
public boolean removeOwner(int segment, Address owner)
public void addPrimaryOwner(int segment, Address newPrimaryOwner)
public void replacePrimaryOwnerWithBackup(int segment, Address newPrimaryOwner)
public DefaultConsistentHash build()
public int getPrimaryOwned(Address node)
public int getOwned(Address node)
public int computeActualNumOwners(int numOwners, List<Address> members, Map<Address,Float> capacityFactors)
public int getNumNodes()
public float getCapacityFactor(Address node)
Copyright © 2021 JBoss by Red Hat. All rights reserved.