use of com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration in project SilverKing by Morgan-Stanley.
the class RecoverOldAttr method main.
public static void main(String[] args) {
if (args.length != 3) {
System.out.println("args: <gridConfig> <file> <version>");
} else {
try {
RecoverOldAttr roa;
SKGridConfiguration gc;
String file;
long version;
gc = SKGridConfiguration.parseFile(args[0]);
file = args[1];
version = Long.parseLong(args[2]);
roa = new RecoverOldAttr(gc);
roa.recover(file, version);
} catch (Exception e) {
e.printStackTrace();
}
}
}
use of com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration in project SilverKing by Morgan-Stanley.
the class DirReader method main.
public static void main(String[] args) {
if (args.length != 2) {
System.out.println("<gridConfig> <dir>");
} else {
try {
DirReader dirReader;
SKGridConfiguration gc;
String dirName;
gc = SKGridConfiguration.parseFile(args[0]);
dirName = args[1];
dirReader = new DirReader(gc);
dirReader.displayDir(dirName);
} catch (Exception e) {
e.printStackTrace();
}
}
}
use of com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration in project SilverKing by Morgan-Stanley.
the class DHTRingMaster method main.
// End RecoverData implementation
// /////////////////////////////////
public static void main(String[] args) {
try {
CmdLineParser parser;
DHTRingMasterOptions options;
SKGridConfiguration gc;
DHTRingMaster dhtRingMaster;
Log.initAsyncLogging();
options = new DHTRingMasterOptions();
parser = new CmdLineParser(options);
try {
int intervalMillis;
parser.parseArgument(args);
gc = SKGridConfiguration.parseFile(options.gridConfig);
LogStreamConfig.configureLogStreams(gc, logFileName);
intervalMillis = options.watchIntervalSeconds * 1000;
LWTPoolProvider.createDefaultWorkPools();
dhtRingMaster = new DHTRingMaster(gc.getClientDHTConfiguration().getZKConfig(), gc.getClientDHTConfiguration().getName(), intervalMillis, options.mode);
Log.warningAsync("DHTRingMaster created");
dhtRingMaster.start();
Log.warningAsync("DHTRingMaster running");
ThreadUtil.sleepForever();
} catch (CmdLineException cle) {
System.err.println(cle.getMessage());
parser.printUsage(System.err);
System.exit(-1);
}
} catch (Exception e) {
e.printStackTrace();
Log.logErrorSevere(e, DHTRingMaster.class.getName(), "main");
System.exit(-1);
}
}
use of com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration in project SilverKing by Morgan-Stanley.
the class DebugKey method main.
public static void main(String[] args) {
if (args.length < 4) {
System.err.println("args: <gridConfig> <ns> <sourceRing> <destRing> <key...>");
} else {
try {
DebugKey dk;
SKGridConfiguration gc;
String namespace;
Pair<Long, Long> sourceRing;
Pair<Long, Long> targetRing;
String[] keys;
gc = SKGridConfiguration.parseFile(args[0]);
namespace = args[1];
sourceRing = getVersionPair(args[2]);
targetRing = getVersionPair(args[3]);
dk = new DebugKey(gc, namespace);
keys = Arrays.copyOfRange(args, 4, args.length);
for (String key : keys) {
dk.debugConvergence(key, sourceRing, targetRing);
}
System.exit(0);
} catch (Exception e) {
e.printStackTrace();
}
}
}
use of com.ms.silverking.cloud.dht.gridconfig.SKGridConfiguration in project SilverKing by Morgan-Stanley.
the class SKAdmin method main.
// /////////////////////////////////////////
public static void main(String[] args) {
boolean success;
success = false;
try {
SKAdmin skAdmin;
SKAdminOptions options;
CmdLineParser parser;
SKGridConfiguration gc;
SKAdminCommand[] commands;
LWTPoolProvider.createDefaultWorkPools();
LWTThreadUtil.setLWTThread();
options = new SKAdminOptions();
parser = new CmdLineParser(options);
try {
parser.parseArgument(args);
} catch (CmdLineException cle) {
System.err.println(cle.getMessage());
parser.printUsage(System.err);
System.exit(-1);
}
fillDefaultOptions(options);
sanityCheckOptions(options);
if (options.gridConfigBase != null) {
gc = SKGridConfiguration.parseFile(new File(options.gridConfigBase), options.gridConfig);
} else {
gc = SKGridConfiguration.parseFile(options.gridConfig);
}
if (options.forceInclusionOfUnsafeExcludedServers) {
Log.countdownWarning("Options requesting unsafe excluded servers. This may result in data loss", unsafeWarningCountdown);
}
skAdmin = new SKAdmin(gc, options);
commands = SKAdminCommand.parseCommands(options.commands);
success = skAdmin.execCommand(commands);
} catch (IneligibleServerException ise) {
throw ise;
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
Log.warning("SKAdmin exiting success=" + success);
if (exitOnCompletion) {
System.exit(success ? 0 : -1);
}
}
Aggregations