use of com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration in project SilverKing by Morgan-Stanley.
the class MultiDHTExampleTest method setUpBeforeClass.
@BeforeClass
public static void setUpBeforeClass() throws ClientException, IOException {
SKGridConfiguration gc = Util.getTestGridConfig();
SKGridConfiguration[] gridConfigurations = { gc, gc };
String[] preferredServers = { Util.getServer1(), Util.getServer2() };
mDht = new MultiDHTExample(gridConfigurations, preferredServers);
}
use of com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration in project SilverKing by Morgan-Stanley.
the class DependencyWatcher method main.
/**
* @param args
*/
public static void main(String[] args) {
try {
CmdLineParser parser;
DependencyWatcherOptions options;
DependencyWatcher dw;
SKGridConfiguration gc;
options = new DependencyWatcherOptions();
parser = new CmdLineParser(options);
try {
parser.parseArgument(args);
gc = SKGridConfiguration.parseFile(options.gridConfig);
TopoRingConstants.setVerbose(true);
dw = new DependencyWatcher(gc, options);
ThreadUtil.sleepForever();
} catch (CmdLineException cle) {
System.err.println(cle.getMessage());
parser.printUsage(System.err);
System.exit(-1);
}
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
}
use of com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration in project SilverKing by Morgan-Stanley.
the class MasterModeDependencyWatcher method main.
public static void main(String[] args) {
try {
MasterModeDependencyWatcherOptions options;
CmdLineParser parser;
options = new MasterModeDependencyWatcherOptions();
parser = new CmdLineParser(options);
try {
MasterModeDependencyWatcher dw;
SKGridConfiguration gc;
parser.parseArgument(args);
gc = SKGridConfiguration.parseFile(options.gridConfig);
TopoRingConstants.setVerbose(true);
gc = SKGridConfiguration.parseFile(options.gridConfig);
dw = new MasterModeDependencyWatcher(gc, options);
ThreadUtil.sleepForever();
} catch (CmdLineException cle) {
System.err.println(cle.getMessage());
parser.printUsage(System.err);
System.exit(-1);
}
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
}
use of com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration in project SilverKing by Morgan-Stanley.
the class NamedRingConfigurationUtil method getRingName.
private static void getRingName(String gcName) throws IOException, KeeperException {
SKGridConfiguration gc;
NamedRingConfiguration ringConfig;
gc = SKGridConfiguration.parseFile(gcName);
ringConfig = fromGridConfiguration(gc);
System.out.println(ringConfig.getRingName());
}
use of com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration in project SilverKing by Morgan-Stanley.
the class ProducerConsumer method main.
public static void main(String[] args) {
try {
if (args.length != 4 && args.length != 5) {
System.out.println("args: <gridConfig> <id> <mode [Producer|Consumer]> <items> [delay]");
} else {
ProducerConsumer pc;
Mode mode;
int items;
SKGridConfiguration gc;
String id;
int delay;
gc = SKGridConfiguration.parseFile(args[0]);
id = args[1];
mode = Mode.valueOf(args[2]);
items = Integer.parseInt(args[3]);
if (args.length == 5) {
delay = Integer.parseInt(args[4]);
} else {
delay = 0;
}
pc = new ProducerConsumer(gc, id, mode, delay);
pc.run(items);
}
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations