OPTION_EXCLUDE_SNAPSHOT, OPTION_ECPOLICY); cf.addOptionWithValue(OPTION_TYPE); cf.parse(args); if (args.isEmpty()) { // default path is the current working directory
@Override protected void processOptions(LinkedList<String> args) throws IOException { CommandFormat cf = new CommandFormat(1, Integer.MAX_VALUE, "f", "p", "l", "d"); cf.addOptionWithValue("t"); cf.parse(args); setNumberThreads(cf.getOptValue("t")); setOverwrite(cf.getOpt("f")); setPreserve(cf.getOpt("p")); setLazyPersist(cf.getOpt("l")); setDirectWrite(cf.getOpt("d")); getRemoteDestination(args); // should have a -r option setRecursive(true); }
/** Constructor */ ClearSpaceQuotaCommand(String[] args, int pos, Configuration conf) { super(conf); CommandFormat c = new CommandFormat(1, Integer.MAX_VALUE); c.addOptionWithValue("storageType"); List<String> parameters = c.parse(args, pos); String storageTypeString = c.getOptValue("storageType"); if (storageTypeString != null) { this.type = StorageType.parseStorageType(storageTypeString); } this.args = parameters.toArray(new String[parameters.size()]); }
protected void addAgeOptions() { CommandFormat format = getCommandFormat(); format.addOptionWithValue(DAYS_FLAG); format.addOptionWithValue(HOURS_FLAG); format.addOptionWithValue(MINUTES_FLAG); format.addOptionWithValue(SECONDS_FLAG); }
/** * Constructor a S3Guard tool with HDFS configuration. * @param conf Configuration. * @param opts any boolean options to support */ protected S3GuardTool(Configuration conf, String...opts) { super(conf); commandFormat = new CommandFormat(0, Integer.MAX_VALUE, opts); // For metadata store URI commandFormat.addOptionWithValue(META_FLAG); // DDB region. commandFormat.addOptionWithValue(REGION_FLAG); }
Init(Configuration conf) { super(conf); // read capacity. getCommandFormat().addOptionWithValue(READ_FLAG); // write capacity. getCommandFormat().addOptionWithValue(WRITE_FLAG); // tag getCommandFormat().addOptionWithValue(TAG_FLAG); }
SetCapacity(Configuration conf) { super(conf); // read capacity. getCommandFormat().addOptionWithValue(READ_FLAG); // write capacity. getCommandFormat().addOptionWithValue(WRITE_FLAG); }
BucketInfo(Configuration conf) { super(conf, GUARDED_FLAG, UNGUARDED_FLAG, AUTH_FLAG, NONAUTH_FLAG, MAGIC_FLAG); CommandFormat format = getCommandFormat(); format.addOptionWithValue(ENCRYPTION_FLAG); }
Uploads(Configuration conf) { super(conf, ABORT, LIST, VERBOSE, FORCE); addAgeOptions(); getCommandFormat().addOptionWithValue(EXPECT); }