Search in sources :

Example 6 with MetaClient

use of com.ms.silverking.cloud.dht.meta.MetaClient in project SilverKing by Morgan-Stanley.

the class StartOfCurrentExclusionTest method main.

/**
 * @param args
 */
public static void main(String[] args) {
    try {
        if (args.length < 2) {
            System.out.println("<gcName> <server>");
        } else {
            InstanceExclusionZK ieZK;
            MetaClient mc;
            String gcName;
            String server;
            Map<String, Long> exclusionSetStartMap;
            long v;
            gcName = args[0];
            server = args[1];
            mc = new MetaClient(SKGridConfiguration.parseFile(gcName));
            ieZK = new InstanceExclusionZK(mc);
            exclusionSetStartMap = ieZK.getStartOfCurrentExclusion(ImmutableSet.of(server));
            v = exclusionSetStartMap.get(server);
            System.out.printf("StartOfCurrentExclusionTest: %s\n", v);
            System.out.printf("mzxid: %d\n", ieZK.getVersionMzxid(v));
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : MetaClient(com.ms.silverking.cloud.dht.meta.MetaClient) InstanceExclusionZK(com.ms.silverking.cloud.dht.meta.InstanceExclusionZK)

Aggregations

MetaClient (com.ms.silverking.cloud.dht.meta.MetaClient)6 IOException (java.io.IOException)3 DHTConfiguration (com.ms.silverking.cloud.dht.meta.DHTConfiguration)2 DHTConfigurationZK (com.ms.silverking.cloud.dht.meta.DHTConfigurationZK)2 ZooKeeperConfig (com.ms.silverking.cloud.zookeeper.ZooKeeperConfig)2 File (java.io.File)2 NamespaceCreationException (com.ms.silverking.cloud.dht.client.NamespaceCreationException)1 NamespaceDeletionException (com.ms.silverking.cloud.dht.client.NamespaceDeletionException)1 NamespaceRecoverException (com.ms.silverking.cloud.dht.client.NamespaceRecoverException)1 RetrievalException (com.ms.silverking.cloud.dht.client.RetrievalException)1 DHTSessionImpl (com.ms.silverking.cloud.dht.client.impl.DHTSessionImpl)1 TimeoutException (com.ms.silverking.cloud.dht.common.TimeoutException)1 DHTNode (com.ms.silverking.cloud.dht.daemon.DHTNode)1 NamespaceNotCreatedException (com.ms.silverking.cloud.dht.daemon.storage.NamespaceNotCreatedException)1 ClassVars (com.ms.silverking.cloud.dht.meta.ClassVars)1 ClassVarsZK (com.ms.silverking.cloud.dht.meta.ClassVarsZK)1 DHTRingCurTargetZK (com.ms.silverking.cloud.dht.meta.DHTRingCurTargetZK)1 InstanceExclusionZK (com.ms.silverking.cloud.dht.meta.InstanceExclusionZK)1 MetaPaths (com.ms.silverking.cloud.dht.meta.MetaPaths)1 NamespaceLinksZK (com.ms.silverking.cloud.dht.meta.NamespaceLinksZK)1