/** * Add the hiveconf properties to the Java system properties, override * anything therein. * * @return a copy of the properties specified in hiveconf */ public Properties addHiveconfToSystemProperties() { Properties confProps = commandLine.getOptionProperties("hiveconf"); for (String propKey : confProps.stringPropertyNames()) { if (verbose) { System.err.println( "hiveconf: " + propKey + "=" + confProps.getProperty(propKey)); } if (propKey.equalsIgnoreCase("hive.root.logger")) { splitAndSetLogger(propKey, confProps); } else { System.setProperty(propKey, confProps.getProperty(propKey)); } } return confProps; }
/** * Parse the arguments. * @param args */ public void parse(String[] args) { try { commandLine = new GnuParser().parse(OPTIONS, args); if (commandLine.hasOption('h')) { printUsage(); System.exit(1); } if (commandLine.hasOption('v')) { verbose = true; } } catch (ParseException e) { System.err.println(e.getMessage()); printUsage(); System.exit(1); } }
@Override public void parse(String[] args) { super.parse(args); // support the old syntax "hivemetastore [port]" but complain args = commandLine.getArgs(); if (args.length > 0) { // complain about the deprecated syntax -- but still run System.err.println( "This usage has been deprecated, consider using the new command " + "line syntax (run with -h to see usage information)"); port = new Integer(args[0]); } // notice that command line options take precedence over the // deprecated (old style) naked args... if (commandLine.hasOption('p')) { port = Integer.parseInt(commandLine.getOptionValue('p')); } else { // legacy handling String metastorePort = System.getenv("METASTORE_PORT"); if (metastorePort != null) { port = Integer.parseInt(metastorePort); } } } }
@Override public void parse(String[] args) { super.parse(args); // support the old syntax "hivemetastore [port]" but complain args = commandLine.getArgs(); if (args.length > 0) { // complain about the deprecated syntax -- but still run System.err.println( "This usage has been deprecated, consider using the new command " + "line syntax (run with -h to see usage information)"); port = new Integer(args[0]); } // notice that command line options take precedence over the // deprecated (old style) naked args... if (commandLine.hasOption('p')) { port = Integer.parseInt(commandLine.getOptionValue('p')); } else { // legacy handling String metastorePort = System.getenv("METASTORE_PORT"); if (metastorePort != null) { port = Integer.parseInt(metastorePort); } } } }
public boolean process_stage1(String[] argv) { try { commandLine = new GnuParser().parse(options, argv); Properties confProps = commandLine.getOptionProperties("hiveconf"); for (String propKey : confProps.stringPropertyNames()) { // with HIVE-11304, hive.root.logger cannot have both logger name and log level. // if we still see it, split logger and level separately for hive.root.logger // and hive.log.level respectively if (propKey.equalsIgnoreCase("hive.root.logger")) { CommonCliOptions.splitAndSetLogger(propKey, confProps); } else { System.setProperty(propKey, confProps.getProperty(propKey)); } } Properties hiveVars = commandLine.getOptionProperties("define"); for (String propKey : hiveVars.stringPropertyNames()) { hiveVariables.put(propKey, hiveVars.getProperty(propKey)); } Properties hiveVars2 = commandLine.getOptionProperties("hivevar"); for (String propKey : hiveVars2.stringPropertyNames()) { hiveVariables.put(propKey, hiveVars2.getProperty(propKey)); } } catch (ParseException e) { System.err.println(e.getMessage()); printUsage(); return false; } return true; }
/** * Parse the arguments. * @param args */ public void parse(String[] args) { try { commandLine = new GnuParser().parse(OPTIONS, args); if (commandLine.hasOption('h')) { printUsage(); System.exit(1); } if (commandLine.hasOption('v')) { verbose = true; } } catch (ParseException e) { System.err.println(e.getMessage()); printUsage(); System.exit(1); } }
@Override public void parse(String[] args) { super.parse(args); // support the old syntax "hivemetastore [port]" but complain args = commandLine.getArgs(); if (args.length > 0) { // complain about the deprecated syntax -- but still run System.err.println( "This usage has been deprecated, consider using the new command " + "line syntax (run with -h to see usage information)"); port = new Integer(args[0]); } // notice that command line options take precedence over the // deprecated (old style) naked args... if (commandLine.hasOption('p')) { port = Integer.parseInt(commandLine.getOptionValue('p')); } else { // legacy handling String metastorePort = System.getenv("METASTORE_PORT"); if (metastorePort != null) { port = Integer.parseInt(metastorePort); } } } }
if (propKey.equalsIgnoreCase("hive.root.logger")) { CommonCliOptions.splitAndSetLogger(propKey, confProps); } else { System.setProperty(propKey, confProps.getProperty(propKey));
/** * Parse the arguments. * @param args */ public void parse(String[] args) { try { commandLine = new GnuParser().parse(OPTIONS, args); if (commandLine.hasOption('h')) { printUsage(); System.exit(1); } if (commandLine.hasOption('v')) { verbose = true; } } catch (ParseException e) { System.err.println(e.getMessage()); printUsage(); System.exit(1); } }
/** * Add the hiveconf properties to the Java system properties, override * anything therein. * * @return a copy of the properties specified in hiveconf */ public Properties addHiveconfToSystemProperties() { Properties confProps = commandLine.getOptionProperties("hiveconf"); for (String propKey : confProps.stringPropertyNames()) { if (verbose) { System.err.println( "hiveconf: " + propKey + "=" + confProps.getProperty(propKey)); } if (propKey.equalsIgnoreCase("hive.root.logger")) { splitAndSetLogger(propKey, confProps); } else { System.setProperty(propKey, confProps.getProperty(propKey)); } } return confProps; }
/** * Parse the arguments. * @param args */ public void parse(String[] args) { try { commandLine = new GnuParser().parse(OPTIONS, args); if (commandLine.hasOption('h')) { printUsage(); System.exit(1); } if (commandLine.hasOption('v')) { verbose = true; } } catch (ParseException e) { System.err.println(e.getMessage()); printUsage(); System.exit(1); } }
public boolean process_stage1(String[] argv) { try { commandLine = new GnuParser().parse(options, argv); Properties confProps = commandLine.getOptionProperties("hiveconf"); for (String propKey : confProps.stringPropertyNames()) { // with HIVE-11304, hive.root.logger cannot have both logger name and log level. // if we still see it, split logger and level separately for hive.root.logger // and hive.log.level respectively if (propKey.equalsIgnoreCase("hive.root.logger")) { CommonCliOptions.splitAndSetLogger(propKey, confProps); } else { System.setProperty(propKey, confProps.getProperty(propKey)); } } Properties hiveVars = commandLine.getOptionProperties("define"); for (String propKey : hiveVars.stringPropertyNames()) { hiveVariables.put(propKey, hiveVars.getProperty(propKey)); } Properties hiveVars2 = commandLine.getOptionProperties("hivevar"); for (String propKey : hiveVars2.stringPropertyNames()) { hiveVariables.put(propKey, hiveVars2.getProperty(propKey)); } } catch (ParseException e) { System.err.println(e.getMessage()); printUsage(); return false; } return true; }
CommonCliOptions.splitAndSetLogger(propKey, confProps); } else { System.setProperty(propKey, confProps.getProperty(propKey));