Search in sources :

Example 21 with SKGridConfiguration

use of com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration in project SilverKing by Morgan-Stanley.

the class StaticDHTCreator method writeGridConfig.

public static void writeGridConfig(ClientDHTConfiguration clientConfig, File gridConfigDir, String gcName) throws IOException {
    // Write GridConfig
    Map<String, String> envMap;
    envMap = new HashMap<>();
    envMap.put(ClientDHTConfiguration.nameVar, clientConfig.getName());
    envMap.put(ClientDHTConfiguration.portVar, Integer.toString(clientConfig.getPort()));
    envMap.put(ClientDHTConfiguration.zkLocVar, clientConfig.getZKConfig().toString());
    writeGridConfig(new SKGridConfiguration(gcName, envMap), gridConfigDir, gcName);
    System.out.println(gcName);
}
Also used : SKGridConfiguration(com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration)

Example 22 with SKGridConfiguration

use of com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration in project SilverKing by Morgan-Stanley.

the class RingCurTargetTool method main.

public static void main(String[] args) {
    try {
        CmdLineParser parser;
        RingCurTargetToolOptions options;
        RingCurTargetTool ringCurTargetTool;
        SKGridConfiguration gc;
        options = new RingCurTargetToolOptions();
        parser = new CmdLineParser(options);
        try {
            parser.parseArgument(args);
            gc = SKGridConfiguration.parseFile(options.gridConfig);
            new RingCurTargetTool().go(gc, options);
        } catch (CmdLineException cle) {
            System.err.println(cle.getMessage());
            parser.printUsage(System.err);
            System.exit(-1);
        }
    } catch (Exception e) {
        e.printStackTrace();
        System.exit(-1);
    }
}
Also used : CmdLineParser(org.kohsuke.args4j.CmdLineParser) SKGridConfiguration(com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration) CmdLineException(org.kohsuke.args4j.CmdLineException) CmdLineException(org.kohsuke.args4j.CmdLineException) KeeperException(org.apache.zookeeper.KeeperException) IOException(java.io.IOException)

Aggregations

SKGridConfiguration (com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration)22 IOException (java.io.IOException)18 KeeperException (org.apache.zookeeper.KeeperException)11 ClientException (com.ms.silverking.cloud.dht.client.ClientException)10 CmdLineException (org.kohsuke.args4j.CmdLineException)8 CmdLineParser (org.kohsuke.args4j.CmdLineParser)8 RetrievalException (com.ms.silverking.cloud.dht.client.RetrievalException)4 PutException (com.ms.silverking.cloud.dht.client.PutException)3 File (java.io.File)3 ConvergencePoint (com.ms.silverking.cloud.dht.daemon.storage.convergence.ConvergencePoint)2 NamespaceVersionMode (com.ms.silverking.cloud.dht.NamespaceVersionMode)1 VersionConstraint (com.ms.silverking.cloud.dht.VersionConstraint)1 ClientDHTConfiguration (com.ms.silverking.cloud.dht.client.ClientDHTConfiguration)1 OperationException (com.ms.silverking.cloud.dht.client.OperationException)1 WaitForCompletionException (com.ms.silverking.cloud.dht.client.WaitForCompletionException)1 RingID (com.ms.silverking.cloud.dht.daemon.storage.convergence.RingID)1 RingIDAndVersionPair (com.ms.silverking.cloud.dht.daemon.storage.convergence.RingIDAndVersionPair)1 IneligibleServerException (com.ms.silverking.cloud.dht.meta.IneligibleServerException)1 MetaToolOptions (com.ms.silverking.cloud.management.MetaToolOptions)1 RingRegion (com.ms.silverking.cloud.ring.RingRegion)1