Search in sources :

Example 11 with ZooKeeperConfig

use of com.ms.silverking.cloud.zookeeper.ZooKeeperConfig in project SilverKing by Morgan-Stanley.

the class MetaTool method doWork.

@Override
protected void doWork(MetaToolOptions options) throws IOException, KeeperException {
    MetaClient mc;
    Tool tool;
    tool = Tool.valueOf(options.tool);
    mc = new MetaClient(namedRingConfigurationFor(tool, options.name), new ZooKeeperConfig(options.zkConfig));
    doWork(options, new MetaToolWorker(getModule(tool, mc)));
}
Also used : ZooKeeperConfig(com.ms.silverking.cloud.zookeeper.ZooKeeperConfig) MetaClient(com.ms.silverking.cloud.toporing.meta.MetaClient)

Example 12 with ZooKeeperConfig

use of com.ms.silverking.cloud.zookeeper.ZooKeeperConfig in project SilverKing by Morgan-Stanley.

the class RingConfigWatcher method main.

/**
 * @param args
 */
public static void main(String[] args) {
    try {
        if (args.length != 3) {
            System.out.println("args: <zkConfig> <ringName> <intervalSeconds>");
        } else {
            ZooKeeperConfig zkConfig;
            RingConfigWatcher rw;
            String ringName;
            long intervalMillis;
            zkConfig = new ZooKeeperConfig(args[0]);
            ringName = args[1];
            intervalMillis = Integer.parseInt(args[2]) * 1000;
            rw = new RingConfigWatcher(zkConfig, ringName, intervalMillis);
            ThreadUtil.sleepForever();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : ZooKeeperConfig(com.ms.silverking.cloud.zookeeper.ZooKeeperConfig) KeeperException(org.apache.zookeeper.KeeperException) IOException(java.io.IOException)

Example 13 with ZooKeeperConfig

use of com.ms.silverking.cloud.zookeeper.ZooKeeperConfig in project SilverKing by Morgan-Stanley.

the class DHTMetaWatcher method main.

public static void main(String[] args) {
    try {
        if (args.length != 3) {
            System.out.println("args: <zkConfig> <mapConfig> <intervalSeconds>>");
        } else {
            ZooKeeperConfig zkConfig;
            DHTMetaWatcher dw;
            String dhtName;
            long intervalMillis;
            zkConfig = new ZooKeeperConfig(args[0]);
            dhtName = args[1];
            intervalMillis = Integer.parseInt(args[2]) * 1000;
            dw = new DHTMetaWatcher(zkConfig, dhtName, intervalMillis);
            dw.addListener(new RingUpdateListenerTest());
            Thread.sleep(60 * 60 * 1000);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : ZooKeeperConfig(com.ms.silverking.cloud.zookeeper.ZooKeeperConfig) KeeperException(org.apache.zookeeper.KeeperException) IOException(java.io.IOException)

Example 14 with ZooKeeperConfig

use of com.ms.silverking.cloud.zookeeper.ZooKeeperConfig in project SilverKing by Morgan-Stanley.

the class MetaTool method doWork.

@Override
protected void doWork(MetaToolOptions options) throws IOException, KeeperException {
    MetaClient mc;
    Tool tool;
    tool = Tool.valueOf(options.tool);
    mc = new MetaClient(cloudConfigurationFor(tool, options.name), new ZooKeeperConfig(options.zkConfig));
    doWork(options, new MetaToolWorker(getModule(tool, mc)));
}
Also used : ZooKeeperConfig(com.ms.silverking.cloud.zookeeper.ZooKeeperConfig) MetaClient(com.ms.silverking.cloud.meta.MetaClient)

Aggregations

ZooKeeperConfig (com.ms.silverking.cloud.zookeeper.ZooKeeperConfig)14 IOException (java.io.IOException)7 KeeperException (org.apache.zookeeper.KeeperException)6 MetaClient (com.ms.silverking.cloud.dht.meta.MetaClient)2 ZooKeeperExtended (com.ms.silverking.cloud.zookeeper.ZooKeeperExtended)2 CmdLineException (org.kohsuke.args4j.CmdLineException)2 CmdLineParser (org.kohsuke.args4j.CmdLineParser)2 GetOptions (com.ms.silverking.cloud.dht.GetOptions)1 NamespaceCreationOptions (com.ms.silverking.cloud.dht.NamespaceCreationOptions)1 PutOptions (com.ms.silverking.cloud.dht.PutOptions)1 ClientDHTConfiguration (com.ms.silverking.cloud.dht.client.ClientDHTConfiguration)1 DHTClient (com.ms.silverking.cloud.dht.client.DHTClient)1 DHTSession (com.ms.silverking.cloud.dht.client.DHTSession)1 DHTNode (com.ms.silverking.cloud.dht.daemon.DHTNode)1 DHTConfiguration (com.ms.silverking.cloud.dht.meta.DHTConfiguration)1 DHTConfigurationZK (com.ms.silverking.cloud.dht.meta.DHTConfigurationZK)1 DHTRingCurTargetZK (com.ms.silverking.cloud.dht.meta.DHTRingCurTargetZK)1 MetaClient (com.ms.silverking.cloud.meta.MetaClient)1 MetaClient (com.ms.silverking.cloud.toporing.meta.MetaClient)1 UUIDBase (com.ms.silverking.id.UUIDBase)1