當前位置: 首頁>>代碼示例>>Java>>正文


Java ParseException.getMessage方法代碼示例

本文整理匯總了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);
}
 
開發者ID:aliyun,項目名稱:aliyun-maxcompute-data-collectors,代碼行數:24,代碼來源:NetezzaManager.java

示例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);
  }
}
 
開發者ID:aliyun,項目名稱:aliyun-maxcompute-data-collectors,代碼行數:9,代碼來源:DirectNetezzaManager.java

示例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;
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:51,代碼來源:JMXGet.java


注:本文中的org.apache.commons.cli.ParseException.getMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。