public abstract void invokeSwap(String storeName, List<String> fetchFiles);
public abstract void invokeRollback(String storeName, long pushVersion);
public static void main(String[] args) throws Exception {
OptionParser parser = new OptionParser();
parser.accepts("help", "print usage information");
parser.accepts("cluster", "[REQUIRED] the voldemort cluster.xml file ")
.withRequiredArg()
.describedAs("cluster.xml");
parser.accepts("name", "[REQUIRED] the name of the store to swap")
.withRequiredArg()
.describedAs("store-name");
parser.accepts("servlet-path", "the path for the read-only management servlet")
.withRequiredArg()
.describedAs("path");
parser.accepts("file", "[REQUIRED] uri of a directory containing the new store files")
.withRequiredArg()
.describedAs("uri");
parser.accepts("timeout", "http timeout for the fetch in ms")
.withRequiredArg()
.describedAs("timeout ms")
.ofType(Integer.class);
parser.accepts("rollback", "Rollback store to older version");
parser.accepts("admin", "Use admin services. Default = false");
parser.accepts("push-version", "[REQUIRED] Version of push to fetch / rollback-to")
.withRequiredArg()
.ofType(Long.class);
OptionSet options = parser.parse(args);
if(options.has("help")) {
parser.printHelpOn(System.out);
System.exit(0);
}
Set<String> missing = CmdUtils.missing(options, "cluster", "name", "file", "push-version");
if(missing.size() > 0) {
if(!(missing.equals(ImmutableSet.of("file")) && (options.has("rollback")))) {
System.err.println("Missing required arguments: " + Joiner.on(", ").join(missing));
parser.printHelpOn(System.err);
System.exit(1);
}
}
String clusterXml = (String) options.valueOf("cluster");