本文整理汇总了Java中org.apache.commons.cli.ParseException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java ParseException.getMessage方法的具体用法?Java ParseException.getMessage怎么用?Java ParseException.getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.cli.ParseException
的用法示例。
在下文中一共展示了ParseException.getMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: importTable
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
@Override
public void importTable(com.cloudera.sqoop.manager.ImportJobContext context)
throws IOException, ImportException {
context.setConnManager(this);
// The user probably should have requested --direct to invoke external
// table option.
// Display a warning informing them of this fact.
if (!NetezzaManager.directModeWarningPrinted) {
LOG.warn("It looks like you are importing from Netezza.");
LOG.warn("This transfer can be faster! Use the --direct");
LOG.warn("option to exercise a Netezza-specific fast path.");
NetezzaManager.directModeWarningPrinted = true; // don't display this
// twice.
}
try {
handleNetezzaImportExtraArgs(context);
} catch (ParseException pe) {
throw (ImportException) new ImportException(pe.getMessage(), pe);
}
// Then run the normal importTable() method.
super.importTable(context);
}
示例2: DirectNetezzaManager
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
public DirectNetezzaManager(SqoopOptions opts) {
super(opts);
try {
handleNetezzaExtraArgs(options);
} catch (ParseException pe) {
throw new RuntimeException(pe.getMessage(), pe);
}
}
示例3: parseArgs
import org.apache.commons.cli.ParseException; //导入方法依赖的package包/类
/**
* parse args
*/
private static CommandLine parseArgs(Options opts, String... args)
throws IllegalArgumentException {
OptionBuilder.withArgName("NameNode|DataNode");
OptionBuilder.hasArg();
OptionBuilder.withDescription("specify jmx service (NameNode by default)");
Option jmx_service = OptionBuilder.create("service");
OptionBuilder.withArgName("mbean server");
OptionBuilder.hasArg();
OptionBuilder
.withDescription("specify mbean server (localhost by default)");
Option jmx_server = OptionBuilder.create("server");
OptionBuilder.withDescription("print help");
Option jmx_help = OptionBuilder.create("help");
OptionBuilder.withArgName("mbean server port");
OptionBuilder.hasArg();
OptionBuilder.withDescription("specify mbean server port, "
+ "if missing - it will try to connect to MBean Server in the same VM");
Option jmx_port = OptionBuilder.create("port");
OptionBuilder.withArgName("VM's connector url");
OptionBuilder.hasArg();
OptionBuilder.withDescription("connect to the VM on the same machine;"
+ "\n use:\n jstat -J-Djstat.showUnsupported=true -snap <vmpid> | "
+ "grep sun.management.JMXConnectorServer.address\n "
+ "to find the url");
Option jmx_localVM = OptionBuilder.create("localVM");
opts.addOption(jmx_server);
opts.addOption(jmx_help);
opts.addOption(jmx_service);
opts.addOption(jmx_port);
opts.addOption(jmx_localVM);
CommandLine commandLine = null;
CommandLineParser parser = new GnuParser();
try {
commandLine = parser.parse(opts, args, true);
} catch (ParseException e) {
printUsage(opts);
throw new IllegalArgumentException("invalid args: " + e.getMessage());
}
return commandLine;
}