/**
* @param args
*/
public static void main(String[] args) throws Exception {
OptionParser parser = new OptionParser();
parser.accepts("cluster-xml", "[REQUIRED] path to cluster.xml file for the server")
.withRequiredArg()
.describedAs("cluster-xml")
.ofType(String.class);
parser.accepts("src", "[REQUIRED] Source environment to be converted")
.withRequiredArg()
.describedAs("source-env")
.ofType(String.class);
parser.accepts("dest", "[REQUIRED] Destination environment to place converted data into")
.withRequiredArg()
.describedAs("destination-env")
.ofType(String.class);
parser.accepts("store", "[REQUIRED] Store/BDB database to convert")
.withRequiredArg()
.describedAs("store")
.ofType(String.class);
parser.accepts("from-format", "[REQUIRED] source format")
.withRequiredArg()
.describedAs("from-format")
.ofType(String.class);
parser.accepts("to-format", "[REQUIRED] destination format")
.withRequiredArg()
.describedAs("to-format")
.ofType(String.class);
parser.accepts("je-log-size", "[Optional] Size of the converted JE log files")
.withRequiredArg()
.describedAs("je-log-size")
.ofType(Integer.class);
parser.accepts("btree-nodemax", "[Optional] Fanout of converted Btree nodes")
.withRequiredArg()
.describedAs("btree-nodemax")
.ofType(Integer.class);
OptionSet options = parser.parse(args);
if(!options.has("cluster-xml") || !options.has("src") || !options.has("dest")
|| !options.has("store") || !options.has("from-format") || !options.has("to-format")) {
parser.printHelpOn(System.err);
System.exit(0);
}
String clusterXmlPath = CmdUtils.valueOf(options, "cluster-xml", null);
String sourceEnvPath = CmdUtils.valueOf(options, "src", null);
String destEnvPath = CmdUtils.valueOf(options, "dest", null);
String storeName = CmdUtils.valueOf(options, "store", null);
String fromFormat = CmdUtils.valueOf(options, "from-format", null);
String toFormat = CmdUtils.valueOf(options, "to-format", null);
if(!isValidFormat(fromFormat) || !isValidFormat(toFormat)) {
parser.printHelpOn(System.err);
System.exit(0);
}
Integer logFileSize = CmdUtils.valueOf(options, "je-log-size", 60);
Integer nodeMax = CmdUtils.valueOf(options, "btree-nodemax", 512);