private DefaultConsistentHash defaultFromReplicated(ReplicatedConsistentHash baseCH) { int numSegments = baseCH.getNumSegments(); List<Address>[] baseSegmentOwners = new List[numSegments]; for (int segment = 0; segment < numSegments; segment++) { baseSegmentOwners[segment] = Collections.singletonList(baseCH.locatePrimaryOwnerForSegment(segment)); } return new DefaultConsistentHash( baseCH.getHashFunction(), 1, numSegments, baseCH.getMembers(), null, baseSegmentOwners); }
@Override public ReplicatedConsistentHash union( ReplicatedConsistentHash ch1, ReplicatedConsistentHash ch2) { return ch1.union(ch2); }