Package org.apache.hadoop.hive.cli

Examples of org.apache.hadoop.hive.cli.OptionsProcessor$MultiPropertyOption


   * This is the initialization process that is carried out for each
   * SessionItem. The goal is to emulate the startup of CLIDriver.
   */
  protected void itemInit() {
    l4j.debug("HWISessionItem itemInit start " + this.getSessionName());
    OptionsProcessor oproc = new OptionsProcessor();

    if (System.getProperty("hwi-args") != null) {
      String[] parts = System.getProperty("hwi-args").split("\\s+");

      if (!oproc.process_stage1(parts)) {
      }
    }

    SessionState.initHiveLog4j();
    conf = new HiveConf(SessionState.class);
View Full Code Here


   * This is the initialization process that is carried out for each
   * SessionItem. The goal is to emulate the startup of CLIDriver.
   */
  private void itemInit() {
    l4j.debug("HWISessionItem itemInit start " + getSessionName());
    OptionsProcessor oproc = new OptionsProcessor();

    if (System.getProperty("hwi-args") != null) {
      String[] parts = System.getProperty("hwi-args").split("\\s+");
      if (!oproc.process_stage1(parts)) {
      }
    }

    SessionState.initHiveLog4j();
    conf = new HiveConf(SessionState.class);
View Full Code Here

  * This is the initialization process that is carried out for each
  * SessionItem. The goal is to emulate the startup of CLIDriver.
  */
  private void itemInit() {
    l4j.debug("HWISessionItem itemInit start " + this.getSessionName());
    OptionsProcessor oproc = new OptionsProcessor();

    if (System.getProperty("hwi-args") != null) {
      String[] parts = System.getProperty("hwi-args").split("\\s+");
      if (!oproc.process_stage1(parts)) {
      }
    }

    SessionState.initHiveLog4j();
    conf = new HiveConf(SessionState.class);
View Full Code Here

   * This is the initialization process that is carried out for each
   * SessionItem. The goal is to emulate the startup of CLIDriver.
   */
  protected void itemInit() {
    l4j.debug("HWISessionItem itemInit start " + this.getSessionName());
    OptionsProcessor oproc = new OptionsProcessor();

    if (System.getProperty("hwi-args") != null) {
      String[] parts = System.getProperty("hwi-args").split("\\s+");

      if (!oproc.process_stage1(parts)) {
      }
    }

    SessionState.initHiveLog4j();
    conf = new HiveConf(SessionState.class);
View Full Code Here

   * This is the initialization process that is carried out for each
   * SessionItem. The goal is to emulate the startup of CLIDriver.
   */
  private void itemInit() {
    l4j.debug("HWISessionItem itemInit start " + getSessionName());
    OptionsProcessor oproc = new OptionsProcessor();

    if (System.getProperty("hwi-args") != null) {
      String[] parts = System.getProperty("hwi-args").split("\\s+");
      if (!oproc.process_stage1(parts)) {
      }
    }

    try {
      LogUtils.initHiveLog4j();
View Full Code Here

  }

  public static int run(String[] args) throws Exception
  {

    OptionsProcessor oproc = new OptionsProcessor();
    if (!oproc.process_stage1(args))
    {
      return 1;
    }

    // NOTE: It is critical to do this here so that log4j is reinitialized
    // before any of the other core hive classes are loaded
    boolean logInitFailed = false;
    String logInitDetailMessage;
    try
    {
      logInitDetailMessage = LogUtils.initHiveLog4j();
    }
    catch (LogInitializationException e)
    {
      logInitFailed = true;
      logInitDetailMessage = e.getMessage();
    }

    CliSessionState ss = new CliSessionState(new HiveConf(
        SessionState.class));
    ss.in = System.in;
    try
    {
      ss.out = new PrintStream(System.out, true, "UTF-8");
      ss.info = new PrintStream(System.err, true, "UTF-8");
      ss.err = new CachingPrintStream(System.err, true, "UTF-8");
    }
    catch (UnsupportedEncodingException e)
    {
      return 3;
    }

    if (!oproc.process_stage2(ss))
    {
      return 2;
    }

    if (!ss.getIsSilent())
    {
      if (logInitFailed)
      {
        System.err.println(logInitDetailMessage);
      }
      else
      {
        SessionState.getConsole().printInfo(logInitDetailMessage);
      }
    }

    // set all properties specified via command line
    HiveConf conf = ss.getConf();
    for (Map.Entry<Object, Object> item : ss.cmdProperties.entrySet())
    {
      conf.set((String) item.getKey(), (String) item.getValue());
      ss.getOverriddenConfigurations().put((String) item.getKey(),
          (String) item.getValue());
    }

    SessionState.start(ss);

    // connect to Hive Server
    if (ss.getHost() != null)
    {
      ss.connect();
      if (ss.isRemoteMode())
      {
        prompt = "[" + ss.getHost() + ':' + ss.getPort() + "] "
            + prompt;
        char[] spaces = new char[prompt.length()];
        Arrays.fill(spaces, ' ');
        prompt2 = new String(spaces);
      }
    }

    // CLI remote mode is a thin client: only load auxJars in local mode
    if (!ss.isRemoteMode() && !ShimLoader.getHadoopShims().usesJobShell())
    {
      // hadoop-20 and above - we need to augment classpath using hiveconf
      // components
      // see also: code in ExecDriver.java
      ClassLoader loader = conf.getClassLoader();
      String auxJars = HiveConf.getVar(conf,
          HiveConf.ConfVars.HIVEAUXJARS);
      if (StringUtils.isNotBlank(auxJars))
      {
        loader = Utilities.addToClassPath(loader,
            StringUtils.split(auxJars, ","));
      }
      conf.setClassLoader(loader);
      Thread.currentThread().setContextClassLoader(loader);
    }

    WindowingHiveCliDriver cli = new WindowingHiveCliDriver();
    cli.setHiveVariables(oproc.getHiveVariables());

    // use the specified database if specified
    cli.processSelectDatabase(ss);

    // Execute -i init files (always in silent mode)
View Full Code Here

   * This is the initialization process that is carried out for each
   * SessionItem. The goal is to emulate the startup of CLIDriver.
   */
  private void itemInit() {
    l4j.debug("HWISessionItem itemInit start " + getSessionName());
    OptionsProcessor oproc = new OptionsProcessor();

    if (System.getProperty("hwi-args") != null) {
      String[] parts = System.getProperty("hwi-args").split("\\s+");
      if (!oproc.process_stage1(parts)) {
      }
    }

    SessionState.initHiveLog4j();
    conf = new HiveConf(SessionState.class);
View Full Code Here

   * This is the initialization process that is carried out for each
   * SessionItem. The goal is to emulate the startup of CLIDriver.
   */
  private void itemInit() {
    l4j.debug("HWISessionItem itemInit start " + getSessionName());
    OptionsProcessor oproc = new OptionsProcessor();

    if (System.getProperty("hwi-args") != null) {
      String[] parts = System.getProperty("hwi-args").split("\\s+");
      if (!oproc.process_stage1(parts)) {
      }
    }

    try {
      LogUtils.initHiveLog4j();
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.cli.OptionsProcessor$MultiPropertyOption

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.