/** * Returns the hashes covered by the member. If the hash of the routing key matches with one of the returned * hashes and the member is capable of handling the command then it will be selected as a target for the * command. * * @return the hashes covered by this member */ public Set<String> hashes() { return IntStream.range(0, segmentCount) .mapToObj(i -> hash(name() + " #" + i)) .collect(Collectors.toSet()); }
/** * Returns the hashes covered by the member. If the hash of the routing key matches with one of the returned * hashes and the member is capable of handling the command then it will be selected as a target for the * command. * * @return the hashes covered by this member */ public Set<String> hashes() { Set<String> newHashes = new TreeSet<>(); for (int t = 0; t < segmentCount; t++) { String hash = hash(name() + " #" + t); newHashes.add(hash); } return newHashes; }
/** * Returns the hashes covered by the member. If the hash of the routing key matches with one of the returned * hashes and the member is capable of handling the command then it will be selected as a target for the * command. * * @return the hashes covered by this member */ public Set<String> hashes() { Set<String> newHashes = new TreeSet<>(); for (int t = 0; t < segmentCount; t++) { String hash = hash(name() + " #" + t); newHashes.add(hash); } return newHashes; }