use of com.ms.silverking.net.IPAndPort in project SilverKing by Morgan-Stanley.
the class ActiveProxyRetrieval method sendSecondaryReplicasUpdate.
private void sendSecondaryReplicasUpdate(SecondaryReplicasUpdate secondaryReplicasUpdate) {
RetrievalResult result;
result = secondaryReplicasUpdate.getResult();
for (IPAndPort replica : secondaryReplicasUpdate.getReplicas()) {
ProtoMessageGroup pmg;
if (debug) {
Log.warning("ActiveProxyRetrieval sending secondary replicas update to ", replica);
}
// pmg = createPutForSecondaryReplicas(result);
pmg = createValueMessageForSecondaryReplicas(result);
messageModule.getMessageGroupBase().send(pmg.toMessageGroup(), replica);
}
}
use of com.ms.silverking.net.IPAndPort in project SilverKing by Morgan-Stanley.
the class MessageModule method establishConnections.
private void establishConnections() {
for (IPAndPort replica : ringMaster.getAllCurrentReplicaServers()) {
ProtoNopMessageGroup nop;
nop = new ProtoNopMessageGroup(mgBase.getMyID());
Log.warning("Priming: ", replica);
mgBase.send(nop.toMessageGroup(), replica);
}
}
use of com.ms.silverking.net.IPAndPort in project SilverKing by Morgan-Stanley.
the class NodeRingMaster2 method getAllCurrentNonExcludedReplicaServers.
private Set<IPAndPort> getAllCurrentNonExcludedReplicaServers() {
Set<IPAndPort> nonExcludedReplicas;
Set<IPAndPort> allReplicas;
ExclusionSet curExclusionSet;
allReplicas = curMapState.getResolvedReplicaMap().allReplicas();
// curExclusionSet = curMapState.getCurrentExclusionSet();
curExclusionSet = latestExclusionSet;
nonExcludedReplicas = ImmutableSet.copyOf(curExclusionSet.filterByIP(allReplicas));
return nonExcludedReplicas;
}
use of com.ms.silverking.net.IPAndPort in project SilverKing by Morgan-Stanley.
the class SimpleIPDistancePrioritizer method main.
public static void main(String[] args) {
try {
SimpleIPDistancePrioritizer p;
IPAndPort[] ips;
IPAndPort referenceIP;
int mask;
referenceIP = new IPAndPort(args[0]);
mask = Integer.parseUnsignedInt(args[1], 16);
ips = new IPAndPort[args.length - 2];
for (int i = 2; i < args.length; i++) {
ips[i - 2] = new IPAndPort(args[i]);
}
p = new SimpleIPDistancePrioritizer(referenceIP, mask);
for (int i = 0; i < ips.length; i++) {
for (int j = 0; j < ips.length; j++) {
System.out.printf("%20s\t%20s\t%s\n", ips[i], ips[j], p.compare(ips[i], ips[j]));
}
System.out.println();
}
} catch (Exception e) {
e.printStackTrace();
}
}
use of com.ms.silverking.net.IPAndPort in project SilverKing by Morgan-Stanley.
the class RingMapState method nodeListToIPAndPortSet.
// /////////////
private Set<IPAndPort> nodeListToIPAndPortSet(List<Node> replicaNodes) {
ImmutableSet.Builder<IPAndPort> replicaSet;
replicaSet = ImmutableSet.builder();
for (Node replicaNode : replicaNodes) {
if (!replicaNode.getNodeClass().equals(NodeClass.server)) {
throw new RuntimeException("Unexpected non-server node class: " + replicaNode);
}
replicaSet.add(new IPAndPort(replicaNode.getIDString(), nodeID.getPort()));
}
return replicaSet.build();
}
Aggregations