diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java index b0a1ca6af0f..0e1f710cdd6 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java @@ -234,16 +234,24 @@ public abstract class AbstractHBaseTool implements Tool { } public int getOptionAsInt(CommandLine cmd, String opt, int defaultValue) { + return getOptionAsInt(cmd, opt, defaultValue, 10); + } + + public int getOptionAsInt(CommandLine cmd, String opt, int defaultValue, int radix) { if (cmd.hasOption(opt)) { - return Integer.parseInt(cmd.getOptionValue(opt)); + return Integer.parseInt(cmd.getOptionValue(opt), radix); } else { return defaultValue; } } public long getOptionAsLong(CommandLine cmd, String opt, int defaultValue) { + return getOptionAsLong(cmd, opt, defaultValue, 10); + } + + public long getOptionAsLong(CommandLine cmd, String opt, int defaultValue, int radix) { if (cmd.hasOption(opt)) { - return Long.parseLong(cmd.getOptionValue(opt)); + return Long.parseLong(cmd.getOptionValue(opt), radix); } else { return defaultValue; } diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java index c215243ed78..a95a9f4d552 100644 --- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java +++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java @@ -927,7 +927,7 @@ public class ExportSnapshot extends AbstractHBaseTool implements Tool { mappers = getOptionAsInt(cmd, Options.MAPPERS.getLongOpt(), mappers); filesUser = cmd.getOptionValue(Options.CHUSER.getLongOpt(), filesUser); filesGroup = cmd.getOptionValue(Options.CHGROUP.getLongOpt(), filesGroup); - filesMode = getOptionAsInt(cmd, Options.CHMOD.getLongOpt(), filesMode); + filesMode = getOptionAsInt(cmd, Options.CHMOD.getLongOpt(), filesMode, 8); bandwidthMB = getOptionAsInt(cmd, Options.BANDWIDTH.getLongOpt(), bandwidthMB); overwrite = cmd.hasOption(Options.OVERWRITE.getLongOpt()); // And verifyChecksum and verifyTarget with values read from old args in processOldArgs(...).