use of com.ms.silverking.cloud.toporing.ResolvedReplicaMap in project SilverKing by Morgan-Stanley.
the class ConvergenceControllerBase method getResolvedReplicaMap.
protected ResolvedReplicaMap getResolvedReplicaMap(DHTMetaUpdate metaUpdate, RingConfiguration ringConfig) {
RingTree ringTreeMinusExclusions;
ResolvedReplicaMap resolvedReplicaMapMinusExclusions;
try {
ringTreeMinusExclusions = RingTreeBuilder.removeExcludedNodes(metaUpdate.getRingTree(), exclusionSet);
} catch (InvalidRingException ire) {
throw new RuntimeException("Unexpected InvalidRingException", ire);
}
resolvedReplicaMapMinusExclusions = ringTreeMinusExclusions.getResolvedMap(ringConfig.getRingParentName(), null);
return resolvedReplicaMapMinusExclusions;
}
use of com.ms.silverking.cloud.toporing.ResolvedReplicaMap in project SilverKing by Morgan-Stanley.
the class DebugKey method debugConvergence.
public void debugConvergence(String key, Triple<String, Long, Long> sourceRing, Triple<String, Long, Long> targetRing) throws IOException, KeeperException, ClientException {
ResolvedReplicaMap sMap;
ResolvedReplicaMap tMap;
DHTKey dhtKey;
dhtKey = keyCreator.createKey(key);
out.printf("Key: %s\n", key);
out.printf("DHTKey: %s\n", KeyUtil.keyToString(dhtKey));
out.printf("Coord: %d\n", KeyUtil.keyToCoordinate(dhtKey));
sMap = readReplicaMap(sourceRing);
tMap = readReplicaMap(targetRing);
out.printf("Source\n");
displayKeyInMap(dhtKey, sMap);
searchForKey(key, dhtKey, sMap);
out.println();
out.printf("Target\n");
displayKeyInMap(dhtKey, tMap);
searchForKey(key, dhtKey, tMap);
}
use of com.ms.silverking.cloud.toporing.ResolvedReplicaMap in project SilverKing by Morgan-Stanley.
the class RingInfo method getRingInfo.
public void getRingInfo(Triple<String, Long, Long> ring) throws IOException, KeeperException, ClientException {
ResolvedReplicaMap rMap;
Map<IPAndPort, Long> aMap;
rMap = readReplicaMap(ring);
aMap = getAllocationMap(rMap);
for (Map.Entry<IPAndPort, Long> e : aMap.entrySet()) {
out.printf("%s\t%d\n", e.getKey(), e.getValue());
}
}
use of com.ms.silverking.cloud.toporing.ResolvedReplicaMap in project SilverKing by Morgan-Stanley.
the class RingMapState2 method newExclusionSet.
// FUTURE - deprecate this
public void newExclusionSet(ExclusionSet exclusionSet, ReplicaPrioritizer replicaPrioritizer) throws InvalidRingException {
RingTree newRingTree;
ResolvedReplicaMap newResolvedReplicaMap;
newRingTree = RingTreeBuilder.removeExcludedNodes(rawRingTree, exclusionSet);
newResolvedReplicaMap = newRingTree.getResolvedMap(ringConfig.getRingParentName(), replicaPrioritizer);
ringTreeMinusExclusions = newRingTree;
resolvedReplicaMapMinusExclusions = newResolvedReplicaMap;
/*
System.out.println("\tResolved Map");
resolvedReplicaMapMinusExclusions.display();
System.out.println("\tEnd Resolved Map");
*/
}
use of com.ms.silverking.cloud.toporing.ResolvedReplicaMap in project SilverKing by Morgan-Stanley.
the class HealthMonitor method dhtMetaUpdate.
@Override
public void dhtMetaUpdate(DHTMetaUpdate dhtMetaUpdate) {
Log.warning(String.format("Received dhtMetaUpdate %s", dhtMetaUpdate));
try {
InstantiatedRingTree rawRingTree;
ResolvedReplicaMap replicaMap;
instanceExclusionZK = new InstanceExclusionZK(dhtMetaUpdate.getMetaClient());
dhtRingCurTargetZK = new DHTRingCurTargetZK(dhtMetaUpdate.getMetaClient(), dhtMetaUpdate.getDHTConfig());
rawRingTree = dhtMetaUpdate.getRingTree();
replicaMap = rawRingTree.getResolvedMap(dhtMetaUpdate.getNamedRingConfiguration().getRingConfiguration().getRingParentName(), null);
activeNodesInMap = replicaMap.allReplicas();
synchronized (this) {
this.notifyAll();
}
} catch (Exception e) {
Log.logErrorWarning(e, "Exception in HealthMonitor.dhtMetaUpdate()");
}
}
Aggregations