Tabnine Logo
org.apache.hive.service.cli.thrift
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.hive.service.cli.thrift

Best Java code snippets using org.apache.hive.service.cli.thrift (Showing top 20 results out of 315)

origin: apache/hive

@Override
public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement,
  Map<String, String> confOverlay) throws HiveSQLException {
 return executeStatementInternal(sessionHandle, statement, confOverlay, true, 0);
}
origin: apache/hive

@Override
public RowSet fetchResults(OperationHandle opHandle) throws HiveSQLException {
 return fetchResults(
   opHandle, FetchOrientation.FETCH_NEXT, defaultFetchRows, FetchType.QUERY_OUTPUT);
}
origin: apache/hive

@Override
public synchronized void init(HiveConf hiveConf) {
 init(hiveConf, null);
}
origin: apache/hive

 private void verifyInitProperty(String key, String value,
   SessionHandle sessionHandle) throws Exception {
  OperationHandle operationHandle =
    client.executeStatement(sessionHandle, "set " + key, null);
  RowSet rowSet = client.fetchResults(operationHandle);
  Assert.assertEquals(1, rowSet.numRows());
  // we know rowSet has only one element
  Assert.assertEquals(key + "=" + value, rowSet.iterator().next()[0]);
  client.closeOperation(operationHandle);
 }
}
origin: apache/hive

private String getServerInstanceURI() throws Exception {
 if ((thriftCLIService == null) || (thriftCLIService.getServerIPAddress() == null)) {
  throw new Exception("Unable to get the server address; it hasn't been initialized yet.");
 }
 return thriftCLIService.getServerIPAddress().getHostName() + ":"
   + thriftCLIService.getPortNumber();
}
origin: apache/hive

private String getUsername(HttpServletRequest request, String authType)
  throws HttpAuthenticationException {
 String creds[] = getAuthHeaderTokens(request, authType);
 // Username must be present
 if (creds[0] == null || creds[0].isEmpty()) {
  throw new HttpAuthenticationException("Authorization header received " +
    "from the client does not contain username.");
 }
 return creds[0];
}
origin: apache/hive

public static CLIServiceClientWrapper newRetryingCLIServiceClient(HiveConf conf) throws HiveSQLException {
 RetryingThriftCLIServiceClient retryClient = new RetryingThriftCLIServiceClient(conf);
 TTransport tTransport = retryClient
  .connectWithRetry(conf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_CLIENT_CONNECTION_RETRY_LIMIT));
 ICLIService cliService =
  (ICLIService) Proxy.newProxyInstance(RetryingThriftCLIServiceClient.class.getClassLoader(),
   CLIServiceClient.class.getInterfaces(), retryClient);
 return new CLIServiceClientWrapper(cliService, tTransport, conf);
}
origin: apache/hive

static ThriftCLIServiceClient getServiceClientInternal() {
 for (Service service : hiveServer2.getServices()) {
  if (service instanceof ThriftBinaryCLIService) {
   return new ThriftCLIServiceClient((ThriftBinaryCLIService) service);
  }
  if (service instanceof ThriftHttpCLIService) {
   return new ThriftCLIServiceClient((ThriftHttpCLIService) service);
  }
 }
 throw new IllegalStateException("HiveServer2 not running Thrift service");
}
origin: apache/hive

@Test
public void testSessionGlobalInitFileWithUser() throws Exception {
 //Test when the session is opened by a user. (HiveSessionImplwithUGI)
 SessionHandle sessionHandle = client.openSession("hive", "password", null);
 verifyInitProperty("a", "1", sessionHandle);
 client.closeSession(sessionHandle);
}
origin: apache/hive

public String getServerHost() throws Exception {
 if ((thriftCLIService == null) || (thriftCLIService.getServerIPAddress() == null)) {
  throw new Exception("Unable to get the server address; it hasn't been initialized yet.");
 }
 return thriftCLIService.getServerIPAddress().getHostName();
}
origin: apache/hive

 @Override
 protected synchronized TTransport connect(HiveConf conf) throws HiveSQLException, TTransportException {
  connectCount++;
  return super.connect(conf);
 }
}
origin: apache/hive

@Override
public synchronized void start() {
 super.start();
 if (!isStarted && !isEmbedded) {
  initServer();
  serverThread = new Thread(this);
  serverThread.setName("Thrift Server");
  serverThread.start();
  isStarted = true;
 }
}
origin: apache/hive

@Override
public synchronized void stop() {
 if (isStarted && !isEmbedded) {
  if (serverThread != null) {
   serverThread.interrupt();
   serverThread = null;
  }
  stopServer();
  isStarted = false;
 }
 super.stop();
}
origin: apache/hive

/**
 * @throws java.lang.Exception
 */
@AfterClass
public static void tearDownAfterClass() throws Exception {
 stopHiveServer2();
}
origin: apache/hive

/**
 * @throws java.lang.Exception
 */
@AfterClass
public static void tearDownAfterClass() throws Exception {
 stopHiveServer2();
}
origin: apache/hive

@Override
public OperationHandle executeStatement(SessionHandle sessionHandle, String statement,
  Map<String, String> confOverlay, long queryTimeout) throws HiveSQLException {
 return executeStatementInternal(sessionHandle, statement, confOverlay, false, queryTimeout);
}
origin: apache/hive

private String getPassword(HttpServletRequest request, String authType)
  throws HttpAuthenticationException {
 String creds[] = getAuthHeaderTokens(request, authType);
 // Password must be present
 if (creds[1] == null || creds[1].isEmpty()) {
  throw new HttpAuthenticationException("Authorization header received " +
    "from the client does not contain username.");
 }
 return creds[1];
}
origin: apache/hive

protected static ThriftCLIServiceClient getServiceClientInternal() {
 for (Service service : hiveServer2.getServices()) {
  if (service instanceof ThriftBinaryCLIService) {
   return new ThriftCLIServiceClient((ThriftBinaryCLIService) service);
  }
  if (service instanceof ThriftHttpCLIService) {
   return new ThriftCLIServiceClient((ThriftHttpCLIService) service);
  }
 }
 throw new IllegalStateException("HiveServer2 not running Thrift service");
}
origin: apache/hive

@Override
public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement,
  Map<String, String> confOverlay, long queryTimeout) throws HiveSQLException {
 return executeStatementInternal(sessionHandle, statement, confOverlay, true, queryTimeout);
}
origin: apache/hive

@Override
public OperationHandle executeStatement(SessionHandle sessionHandle, String statement,
  Map<String, String> confOverlay) throws HiveSQLException {
 return executeStatementInternal(sessionHandle, statement, confOverlay, false, 0);
}
org.apache.hive.service.cli.thrift

Most used classes

  • ThriftCLIServiceClient
    ThriftCLIServiceClient.
  • TStatus
  • EmbeddedThriftBinaryCLIService
    EmbeddedThriftBinaryCLIService.
  • TCLIService$Client
  • TCLIService$Iface
  • TCancelDelegationTokenResp,
  • TCancelOperationReq,
  • TCancelOperationResp,
  • TCloseOperationReq,
  • TCloseOperationResp,
  • TCloseSessionReq,
  • TColumnDesc,
  • TExecuteStatementReq,
  • TExecuteStatementResp,
  • TFetchResultsReq,
  • TFetchResultsResp,
  • TGetCatalogsReq,
  • TGetCatalogsResp,
  • TGetColumnsReq
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now