use of com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration in project SilverKing by Morgan-Stanley.
the class HealthMonitor method main.
// ////////////////////////
public static void main(String[] args) {
try {
CmdLineParser parser;
HealthMonitorOptions options;
HealthMonitor healthMonitor;
SKGridConfiguration gc;
options = new HealthMonitorOptions();
parser = new CmdLineParser(options);
try {
ConvictionLimits convictionLimits;
parser.parseArgument(args);
gc = SKGridConfiguration.parseFile(options.gridConfig);
convictionLimits = ConvictionLimits.parse(options.convictionLimits);
LogStreamConfig.configureLogStreams(gc, logFileName);
healthMonitor = new HealthMonitor(gc, gc.getClientDHTConfiguration().getZKConfig(), options.watchIntervalSeconds, options.guiltThreshold, options.doctorRoundIntervalSeconds, options.forceInclusionOfUnsafeExcludedServers, convictionLimits, options.doctorNodeStartupTimeoutSeconds, options.disableAddition);
healthMonitor.monitor();
} 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 MemoizedFibonacci method main.
public static void main(String[] args) {
try {
if (args.length != 2) {
usage();
} else {
MemoizedFibonacci fib;
SKGridConfiguration gridConfig;
int n;
int fn;
gridConfig = SKGridConfiguration.parseFile(args[0]);
n = Integer.parseInt(args[1]);
if (n < 1) {
System.out.printf("n must be >= 1 for this demo\n");
} else {
fib = new MemoizedFibonacci(gridConfig);
fn = fib.fibonacci(n);
System.out.printf("fibonacci(%d) = %d", n, fn);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
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) {
usage();
} else {
ProducerConsumer pc;
SKGridConfiguration gridConfig;
Mode mode;
int startKey;
int endKey;
gridConfig = SKGridConfiguration.parseFile(args[0]);
mode = Mode.valueOf(args[1]);
startKey = Integer.parseInt(args[2]);
endKey = Integer.parseInt(args[3]);
pc = new ProducerConsumer(gridConfig);
pc.run(mode, startKey, endKey);
}
} catch (Exception e) {
e.printStackTrace();
}
}
use of com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration in project SilverKing by Morgan-Stanley.
the class AsyncMemoizedFibonacci method main.
public static void main(String[] args) {
try {
if (args.length != 2) {
usage();
} else {
AsyncMemoizedFibonacci fib;
SKGridConfiguration gridConfig;
int n;
int fn;
gridConfig = SKGridConfiguration.parseFile(args[0]);
n = Integer.parseInt(args[1]);
if (n < 1) {
System.out.printf("n must be >= 1 for this demo\n");
} else {
fib = new AsyncMemoizedFibonacci(gridConfig);
fn = fib.fibonacci(n);
System.out.printf("fibonacci(%d) = %d", n, fn);
System.out.printf("\nWaiting for async writes to complete...\n");
fib.waitForAsyncWrites();
System.out.printf("Async writes are complete\n");
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
use of com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration in project SilverKing by Morgan-Stanley.
the class ExclusionFileMonitor method main.
// ////////////////////
public static void main(String[] args) {
try {
CmdLineParser parser;
ExclusionFileMonitorOptions options;
ExclusionFileMonitor exclusionFileMonitor;
SKGridConfiguration gc;
options = new ExclusionFileMonitorOptions();
parser = new CmdLineParser(options);
try {
parser.parseArgument(args);
gc = SKGridConfiguration.parseFile(options.gridConfig);
LogStreamConfig.configureLogStreams(gc, logFileName);
exclusionFileMonitor = new ExclusionFileMonitor(gc, options.watchIntervalSeconds, options.exclusionFile);
exclusionFileMonitor.monitor();
} catch (CmdLineException cle) {
System.err.println(cle.getMessage());
parser.printUsage(System.err);
System.exit(-1);
}
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
}
Aggregations