protected static class DefaultConsistentHashFactory.Builder extends Object
Constructor and Description |
---|
DefaultConsistentHashFactory.Builder(DefaultConsistentHash baseCH) |
DefaultConsistentHashFactory.Builder(DefaultConsistentHashFactory.Builder other) |
DefaultConsistentHashFactory.Builder(DefaultConsistentHash baseCH,
List<Address> actualMembers,
Map<Address,Float> actualCapacityFactors) |
DefaultConsistentHashFactory.Builder(Hash hashFunction,
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) |
float |
getOwnedPerCapacity(Address node) |
List<Address> |
getOwners(int segment) |
float |
getPrimaryOwnedPerCapacity(Address node) |
Address |
getPrimaryOwner(int segment) |
float |
getTotalCapacity() |
boolean |
removeOwner(int segment,
Address owner) |
void |
replacePrimaryOwnerWithBackup(int segment,
Address newPrimaryOwner) |
public DefaultConsistentHashFactory.Builder(Hash hashFunction, int numOwners, int numSegments, List<Address> members, Map<Address,Float> capacityFactors)
public DefaultConsistentHashFactory.Builder(DefaultConsistentHash baseCH, List<Address> actualMembers, Map<Address,Float> actualCapacityFactors)
public DefaultConsistentHashFactory.Builder(DefaultConsistentHash baseCH)
public DefaultConsistentHashFactory.Builder(DefaultConsistentHashFactory.Builder other)
public int getActualNumOwners()
public int getNumSegments()
public int getNumNodes()
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 getOwned(Address node)
public float getCapacityFactor(Address node)
public float getTotalCapacity()
public float getPrimaryOwnedPerCapacity(Address node)
public float getOwnedPerCapacity(Address node)
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.