Package org.apache.hive.service.cli

Examples of org.apache.hive.service.cli.SessionHandle


    client.closeSession(sessHandle);
  }

  @Test
  public void testGetFunctions() throws Exception {
    SessionHandle sessHandle = client.openSession(USERNAME,
        PASSWORD, new HashMap<String, String>());
    assertNotNull("Session handle should not be null", sessHandle);

    String catalogName = null;
    String schemaName = null;
View Full Code Here


   */
  @Test
  public void testExecuteStatement() throws Exception {
    Map<String, String> opConf = new HashMap<String, String>();
    // Open a new client session
    SessionHandle sessHandle = client.openSession(USERNAME,
        PASSWORD, opConf);
    // Session handle should not be null
    assertNotNull("Session handle should not be null", sessHandle);

    // Change lock manager to embedded mode
View Full Code Here

  }

  @Test
  public void testSessionHook () throws Exception {
    // create session, test if the hook got fired by checking the expected property
    SessionHandle sessionHandle = client.openSession(sessionUserName, "foobar",
          Collections.<String, String>emptyMap());
    Assert.assertEquals(1, SessionHookTest.runCount.get());
    client.closeSession(sessionHandle);
  }
View Full Code Here

   */
  @Test
  public void testExecuteStatementAsync() throws Exception {
    Map<String, String> opConf = new HashMap<String, String>();
    // Open a new client session
    SessionHandle sessHandle = client.openSession(USERNAME,
        PASSWORD, opConf);
    // Session handle should not be null
    assertNotNull("Session handle should not be null", sessHandle);

    OperationHandle opHandle;
View Full Code Here

    String connectingUser = "user1";
    String proxyUser = System.getProperty("user.name");
    Map<String, String>sessConf = new HashMap<String,String>();
    sessConf.put(HiveAuthFactory.HS2_PROXY_USER, proxyUser);
    sessionUserName = proxyUser;
    SessionHandle sessionHandle = client.openSession(connectingUser, "foobar", sessConf);
    Assert.assertEquals(1, SessionHookTest.runCount.get());
    client.closeSession(sessionHandle);
  }
View Full Code Here

  @Test
  public void testConnection() throws Exception {
    String tabName = "testTab1";
    CLIServiceClient serviceClient = miniHS2.getServiceClient();
    SessionHandle sessHandle = serviceClient.openSession("foo", "bar");
    serviceClient.executeStatement(sessHandle, "DROP TABLE IF EXISTS tab", confOverlay);
    serviceClient.executeStatement(sessHandle, "CREATE TABLE " + tabName + " (id INT)", confOverlay);
    OperationHandle opHandle = serviceClient.executeStatement(sessHandle, "SHOW TABLES", confOverlay);
    RowSet rowSet = serviceClient.fetchResults(opHandle);
    assertFalse(rowSet.numRows() == 0);
View Full Code Here

  }

  @Test
  public void testGetVariableValue() throws Exception {
    CLIServiceClient serviceClient = miniHS2.getServiceClient();
    SessionHandle sessHandle = serviceClient.openSession("foo", "bar");
    OperationHandle opHandle = serviceClient.executeStatement(sessHandle, "set system:os.name", confOverlay);
    RowSet rowSet = serviceClient.fetchResults(opHandle);
    Assert.assertEquals(1, rowSet.numRows());
  }
View Full Code Here

  private void waitForStartup() throws Exception {
    int waitTime = 0;
    long startupTimeout = 1000L * 1000000000L;
    CLIServiceClient hs2Client = getServiceClientInternal();
    SessionHandle sessionHandle = null;
    do {
      Thread.sleep(500L);
      waitTime += 500L;
      if (waitTime > startupTimeout) {
        throw new TimeoutException("Couldn't access new HiveServer2: " + getJdbcURL());
View Full Code Here

  private void waitForStartup() throws Exception {
    int waitTime = 0;
    long startupTimeout = 1000L * 1000000000L;
    CLIServiceClient hs2Client = getServiceClientInternal();
    SessionHandle sessionHandle = null;
    do {
      Thread.sleep(500L);
      waitTime += 500L;
      if (waitTime > startupTimeout) {
        throw new TimeoutException("Couldn't access new HiveServer2: " + getJdbcURL());
View Full Code Here

    client.closeSession(sessHandle);
  }

  @Test
  public void testGetFunctions() throws Exception {
    SessionHandle sessHandle = client.openSession(USERNAME,
        PASSWORD, new HashMap<String, String>());
    assertNotNull("Session handle should not be null", sessHandle);

    String catalogName = null;
    String schemaName = null;
View Full Code Here

TOP

Related Classes of org.apache.hive.service.cli.SessionHandle

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.