protected static class SyncConsistentHashFactory.Builder extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
actualNumOwners |
protected Map<Address,Float> |
capacityFactors |
protected Hash |
hashFunction |
protected boolean |
ignoreMaxSegments |
protected int |
numOwners |
protected int |
numSegments |
protected List<Address>[] |
segmentOwners |
protected int |
segmentSize |
protected List<Address> |
sortedMembers |
protected OwnershipStatistics |
stats |
Modifier | Constructor and Description |
---|---|
protected |
Builder(Hash hashFunction,
int numOwners,
int numSegments,
List<Address> members,
Map<Address,Float> capacityFactors) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
addBackupOwner(int segment,
Address candidate) |
protected void |
addOwnerNoCheck(int segment,
Address owner) |
protected boolean |
addPrimaryOwner(int segment,
Address candidate) |
protected boolean |
canAddOwners(List<Address> owners) |
protected double |
computeExpectedSegmentsForNode(Address node,
int numCopies) |
protected float |
computeTotalCapacity() |
protected void |
copyOwners() |
protected void |
doCopyOwners() |
protected int |
nextSegment(int segment) |
protected int |
normalizedHash(Hash hashFunction,
int hashcode) |
protected void |
populateOwners(int numSegments) |
protected List<Address> |
sort(List<Address> members,
Map<Address,Float> capacityFactors) |
protected final Hash hashFunction
protected final int numOwners
protected final int actualNumOwners
protected final int numSegments
protected final int segmentSize
protected final OwnershipStatistics stats
protected boolean ignoreMaxSegments
protected void addOwnerNoCheck(int segment, Address owner)
protected float computeTotalCapacity()
protected void copyOwners()
protected void doCopyOwners()
protected int nextSegment(int segment)
protected void populateOwners(int numSegments)
protected double computeExpectedSegmentsForNode(Address node, int numCopies)
protected boolean addPrimaryOwner(int segment, Address candidate)
protected boolean addBackupOwner(int segment, Address candidate)
protected int normalizedHash(Hash hashFunction, int hashcode)
Copyright © 2020 JBoss, a division of Red Hat. All rights reserved.