use of com.ms.silverking.cloud.ring.RingRegion in project SilverKing by Morgan-Stanley.
the class ChecksumTreeServer method computeChecksumTreeGroup.
/**
* Computes a new ChecksumTreeGroup given a version. Uses the regions in the ringMaster.
* @param ringID TODO
* @param minVersion
* @param maxVersion
* @return
*/
private ChecksumTreeGroup computeChecksumTreeGroup(RingIDAndVersionPair ringIDAndVersion, long minVersion, long maxVersion) {
Collection<RingRegion> regions;
Log.info("computeChecksumTreeGroup ", maxVersion);
if (debug) {
System.out.printf("computeChecksumTreeGroup %x\t%s\n", ns, ringIDAndVersion);
}
regions = ringMaster.getRegions(ringIDAndVersion);
if (regions != null) {
if (debug) {
System.out.println();
for (RingRegion region : regions) {
System.out.printf("%s\n", region);
}
System.out.println();
}
return computeChecksumTreeGroup(regions, minVersion, maxVersion, false);
} else {
return null;
}
}
use of com.ms.silverking.cloud.ring.RingRegion in project SilverKing by Morgan-Stanley.
the class MessageModule method handleChecksumTreeRequest.
private void handleChecksumTreeRequest(MessageGroup message, MessageGroupConnection connection) {
ConvergencePoint targetCP;
ConvergencePoint sourceCP;
RingRegion region;
boolean localFlag;
if (Log.levelMet(Level.FINE)) {
Log.warning("handleChecksumTreeRequest");
message.displayForDebug();
}
targetCP = ProtoChecksumTreeRequestMessageGroup.getTargetConvergencePoint(message);
sourceCP = ProtoChecksumTreeRequestMessageGroup.getSourceConvergencePoint(message);
region = ProtoChecksumTreeRequestMessageGroup.getRegion(message);
localFlag = ProtoChecksumTreeRequestMessageGroup.getLocalFlag(message);
// targetCP, sourceCP, connection, message.getOriginator(), region);
if (!localFlag) {
storage.asyncInvocation("getChecksumTreeForRemote", message.getContext(), message.getUUID(), targetCP, sourceCP, connection, message.getOriginator(), region);
} else {
IPAndPort replica;
replica = ProtoChecksumTreeRequestMessageGroup.getReplica(message);
storage.asyncInvocation("getChecksumTreeForLocal", message.getContext(), message.getUUID(), targetCP, sourceCP, connection, message.getOriginator(), region, replica, message.getDeadlineRelativeMillis());
}
}
Aggregations