Search in sources :

Example 21 with RingRegion

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;
    }
}
Also used : RingRegion(com.ms.silverking.cloud.ring.RingRegion)

Example 22 with RingRegion

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());
    }
}
Also used : IPAndPort(com.ms.silverking.net.IPAndPort) RingRegion(com.ms.silverking.cloud.ring.RingRegion) ConvergencePoint(com.ms.silverking.cloud.dht.daemon.storage.convergence.ConvergencePoint)

Aggregations

RingRegion (com.ms.silverking.cloud.ring.RingRegion)22 IntersectionResult (com.ms.silverking.cloud.ring.IntersectionResult)5 IPAndPort (com.ms.silverking.net.IPAndPort)4 KeyAndVersionChecksum (com.ms.silverking.cloud.dht.daemon.storage.KeyAndVersionChecksum)3 ConvergencePoint (com.ms.silverking.cloud.dht.daemon.storage.convergence.ConvergencePoint)3 RingEntry (com.ms.silverking.cloud.toporing.RingEntry)2 AbstractChecksumNode (com.ms.silverking.cloud.dht.daemon.storage.convergence.AbstractChecksumNode)1 ChecksumNode (com.ms.silverking.cloud.dht.daemon.storage.convergence.ChecksumNode)1 LeafChecksumNode (com.ms.silverking.cloud.dht.daemon.storage.convergence.LeafChecksumNode)1 NonLeafChecksumNode (com.ms.silverking.cloud.dht.daemon.storage.convergence.NonLeafChecksumNode)1 RingID (com.ms.silverking.cloud.dht.daemon.storage.convergence.RingID)1 RingIDAndVersionPair (com.ms.silverking.cloud.dht.daemon.storage.convergence.RingIDAndVersionPair)1 SKGridConfiguration (com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration)1 MessageGroup (com.ms.silverking.cloud.dht.net.MessageGroup)1 ProtoChecksumTreeMessageGroup (com.ms.silverking.cloud.dht.net.ProtoChecksumTreeMessageGroup)1 ProtoChecksumTreeRequestMessageGroup (com.ms.silverking.cloud.dht.net.ProtoChecksumTreeRequestMessageGroup)1 UUIDBase (com.ms.silverking.id.UUIDBase)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1