use of com.ms.silverking.net.IPAndPort in project SilverKing by Morgan-Stanley.
the class PrimarySecondaryIPListPair method toString.
public String toString(String primaryPrefix, String secondaryPrefix, String psDelimiter) {
StringBuilder sb;
sb = new StringBuilder();
sb.append(primaryPrefix);
for (IPAndPort owner : primaryOwners) {
sb.append(owner);
sb.append(' ');
}
sb.append(psDelimiter);
sb.append(secondaryPrefix);
for (IPAndPort owner : secondaryOwners) {
sb.append(owner);
sb.append(' ');
}
return sb.toString();
}
use of com.ms.silverking.net.IPAndPort in project SilverKing by Morgan-Stanley.
the class ResolvedReplicaMap method nodesToIPAndPort.
private static IPAndPort[] nodesToIPAndPort(List<Node> replicaNodes) {
IPAndPort[] replicas;
replicas = new IPAndPort[replicaNodes.size()];
for (int i = 0; i < replicas.length; i++) {
replicas[i] = new IPAndPort(replicaNodes.get(i).getIDString(), DHTNode.getServerPort());
}
return replicas;
}
use of com.ms.silverking.net.IPAndPort in project SilverKing by Morgan-Stanley.
the class ExclusionSet method asIPAndPortSet.
public Set<IPAndPort> asIPAndPortSet(int port) {
Set<IPAndPort> s;
s = new HashSet<>();
for (String server : serverSet.getServers()) {
s.add(new IPAndPort(server, port));
}
return ImmutableSet.copyOf(s);
}
use of com.ms.silverking.net.IPAndPort in project SilverKing by Morgan-Stanley.
the class ExclusionSet method filterByIP.
public List<IPAndPort> filterByIP(Collection<IPAndPort> raw) {
List<IPAndPort> filtered;
filtered = new ArrayList<>(raw.size());
for (IPAndPort node : raw) {
boolean excluded;
excluded = false;
for (String server : getServers()) {
if (node.getIPAsString().equals(server)) {
excluded = true;
break;
}
}
if (!excluded) {
filtered.add(node);
}
}
return filtered;
}
use of com.ms.silverking.net.IPAndPort in project SilverKing by Morgan-Stanley.
the class RingEntry method nodesToIPAndPort.
private static IPAndPort[] nodesToIPAndPort(List<Node> replicaNodes) {
IPAndPort[] replicas;
replicas = new IPAndPort[replicaNodes.size()];
for (int i = 0; i < replicas.length; i++) {
replicas[i] = new IPAndPort(replicaNodes.get(i).getIDString(), DHTNode.getServerPort());
}
return replicas;
}
Aggregations