Examples of HiveServer2


Examples of org.apache.hive.service.server.HiveServer2

  public static void preTests() throws Exception {
    HiveConf hiveConf = new HiveConf();
    //  hiveConf.logVars(System.err);
    // System.err.flush();

    hiveServer2 = new HiveServer2();
    hiveServer2.init(hiveConf);
    System.err.println("Starting HiveServer2...");
    hiveServer2.start();
    Thread.sleep(1000);
  }
View Full Code Here

Examples of org.apache.hive.service.server.HiveServer2

    // though is has been created before in this JVM
    Reflection.staticField("createDefaultDB")
      .ofType(boolean.class)
      .in(HiveMetaStore.HMSHandler.class)
      .set(false);
    hiveServer2 = new HiveServer2();
    this.conf = conf;
  }
View Full Code Here

Examples of org.apache.hive.service.server.HiveServer2

    // though is has been created before in this JVM
    Reflection.staticField("createDefaultDB")
      .ofType(boolean.class)
      .in(HiveMetaStore.HMSHandler.class)
      .set(false);
    hiveServer2 = new HiveServer2();
    this.conf = conf;
  }
View Full Code Here

Examples of org.apache.hive.service.server.HiveServer2

   */
  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    // Find a free port
    port = MetaStoreUtils.findFreePort();
    hiveServer2 = new HiveServer2();
    hiveConf = new HiveConf();
  }
View Full Code Here

Examples of org.apache.hive.service.server.HiveServer2

   * @throws Exception
   */
  @Test
  public void testNewConnectionConfiguration() throws Exception {
    // Start HiveServer2 with default conf
    HiveServer2 hiveServer2 = new HiveServer2();
    hiveServer2.init(new HiveConf());
    hiveServer2.start();
    Thread.sleep(3000);

    // Set some conf parameters
    String hiveConf = "hive.cli.print.header=true;hive.server2.async.exec.shutdown.timeout=20;" +
        "hive.server2.async.exec.threads=30;hive.server2.thrift.http.max.worker.threads=15";
    // Set some conf vars
    String hiveVar = "stab=salesTable;icol=customerID";
    String jdbcUri = "jdbc:hive2://localhost:10000/default" +
        "?" + hiveConf +
        "#" + hiveVar;

    // Open a new connection with these conf & vars
    Connection con1 = DriverManager.getConnection(jdbcUri);

    // Execute "set" command and retrieve values for the conf & vars specified above
    // Assert values retrieved
    Statement stmt = con1.createStatement();

    // Verify that the property has been properly set while creating the connection above
    verifyConfProperty(stmt, "hive.cli.print.header", "true");
    verifyConfProperty(stmt, "hive.server2.async.exec.shutdown.timeout", "20");
    verifyConfProperty(stmt, "hive.server2.async.exec.threads", "30");
    verifyConfProperty(stmt, "hive.server2.thrift.http.max.worker.threads", "15");
    verifyConfProperty(stmt, "stab", "salesTable");
    verifyConfProperty(stmt, "icol", "customerID");
    con1.close();

    if(hiveServer2 != null) {
      hiveServer2.stop();
    }
  }
View Full Code Here

Examples of org.apache.hive.service.server.HiveServer2

    System.setProperty(HiveConf.ConfVars.LOCALSCRATCHDIR.varname,
        baseDir.getPath() + File.separator + "scratch");
  }

  public void start(Map<String, String> confOverlay) throws Exception {
    hiveServer2 = new HiveServer2();
    // Set confOverlay parameters
    for (Map.Entry<String, String> entry : confOverlay.entrySet()) {
      setConfProperty(entry.getKey(), entry.getValue());
    }
    hiveServer2.init(getHiveConf());
View Full Code Here

Examples of org.apache.hive.service.server.HiveServer2

    hiveConf.setVar(HiveConf.ConfVars.HIVE_LOCK_MANAGER, "org.apache.hadoop.hive.ql.lockmgr.EmbeddedLockManager");

    //  hiveConf.logVars(System.err);
    // System.err.flush();

    hiveServer2 = new HiveServer2();
    hiveServer2.init(hiveConf);
    System.err.println("Starting HiveServer2...");
    hiveServer2.start();
    Thread.sleep(1000);
    createTable();
View Full Code Here

Examples of org.apache.hive.service.server.HiveServer2

    hiveConf.set("hive.server2.custom.authentication.class",
        "org.apache.hive.service.auth.TestCustomAuthentication$SimpleAuthenticationProviderImpl");
    FileOutputStream fos = new FileOutputStream(new File(hiveConf.getHiveSiteLocation().toURI()));
    hiveConf.writeXml(fos);
    fos.close();
    hiveserver2 = new HiveServer2();
    hiveserver2.init(hiveConf);
    hiveserver2.start();
    Thread.sleep(1000);
    System.out.println("hiveServer2 start ......");
  }
View Full Code Here

Examples of org.apache.hive.service.server.HiveServer2

    System.setProperty(HiveConf.ConfVars.LOCALSCRATCHDIR.varname,
        baseDir.getPath() + File.separator + "scratch");
  }

  public void start(Map<String, String> confOverlay) throws Exception {
    hiveServer2 = new HiveServer2();
    // Set confOverlay parameters
    for (Map.Entry<String, String> entry : confOverlay.entrySet()) {
      setConfProperty(entry.getKey(), entry.getValue());
    }
    hiveServer2.init(getHiveConf());
View Full Code Here

Examples of org.apache.hive.service.server.HiveServer2

    // though is has been created before in this JVM
    Reflection.staticField("createDefaultDB")
      .ofType(boolean.class)
      .in(HiveMetaStore.HMSHandler.class)
      .set(false);
    hiveServer2 = new HiveServer2();
    this.conf = conf;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.