Search in sources :

Example 1 with RingIDAndVersionPair

use of com.ms.silverking.cloud.dht.daemon.storage.convergence.RingIDAndVersionPair in project SilverKing by Morgan-Stanley.

the class ChecksumTreeDebug method main.

public static void main(String[] args) {
    try {
        if (args.length < 8) {
            System.out.println("args: <gridConfig> <sourceIP> <namespace> <dhtConfigVersion> <ringName> <sourceRing> <targetRing> <ringRegion> [dataVersion]");
        } else {
            ChecksumTreeDebug ctd;
            SKGridConfiguration gc;
            IPAndPort sourceNode;
            long namespace;
            int dhtConfigVersion;
            RingID ringID;
            Pair<Long, Long> sourceRing;
            Pair<Long, Long> targetRing;
            ConvergencePoint sourceCP;
            ConvergencePoint targetCP;
            RingRegion ringRegion;
            long dataVersion;
            LWTPoolProvider.createDefaultWorkPools();
            gc = SKGridConfiguration.parseFile(args[0]);
            sourceNode = new IPAndPort(args[1], gc.getClientDHTConfiguration().getPort());
            namespace = NamespaceUtil.nameToLong(args[2]);
            dhtConfigVersion = Integer.parseInt(args[3]);
            ringID = RingID.nameToRingID(args[4]);
            sourceRing = getVersionPair(args[5]);
            targetRing = getVersionPair(args[6]);
            ringRegion = RingRegion.parseZKString(args[7]);
            if (args.length >= 9) {
                dataVersion = Long.parseLong(args[8]);
            } else {
                dataVersion = Long.MAX_VALUE;
            }
            sourceCP = new ConvergencePoint(dhtConfigVersion, new RingIDAndVersionPair(ringID, sourceRing), dataVersion);
            targetCP = new ConvergencePoint(dhtConfigVersion, new RingIDAndVersionPair(ringID, targetRing), dataVersion);
            ctd = new ChecksumTreeDebug();
            ctd.debug(sourceNode, namespace, ringRegion, sourceCP, targetCP);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : IPAndPort(com.ms.silverking.net.IPAndPort) RingID(com.ms.silverking.cloud.dht.daemon.storage.convergence.RingID) RingRegion(com.ms.silverking.cloud.ring.RingRegion) ConvergencePoint(com.ms.silverking.cloud.dht.daemon.storage.convergence.ConvergencePoint) SKGridConfiguration(com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration) RingIDAndVersionPair(com.ms.silverking.cloud.dht.daemon.storage.convergence.RingIDAndVersionPair) ConvergencePoint(com.ms.silverking.cloud.dht.daemon.storage.convergence.ConvergencePoint) IOException(java.io.IOException)

Aggregations

ConvergencePoint (com.ms.silverking.cloud.dht.daemon.storage.convergence.ConvergencePoint)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 RingRegion (com.ms.silverking.cloud.ring.RingRegion)1 IPAndPort (com.ms.silverking.net.IPAndPort)1 IOException (java.io.IOException)1