Package co.cask.cdap.proto

Examples of co.cask.cdap.proto.QueryHandle


      Map<String, String> sessionConf = startSession();
      SessionHandle sessionHandle = cliService.openSession("", "", sessionConf);
      try {
        OperationHandle operationHandle = cliService.getColumns(sessionHandle, catalog, schemaPattern,
                                                                tableNamePattern, columnNamePattern);
        QueryHandle handle = saveOperationInfo(operationHandle, sessionHandle, sessionConf, "");
        LOG.trace("Retrieving columns: catalog {}, schemaPattern {}, tableNamePattern {}, columnNamePattern {}",
                  catalog, schemaPattern, tableNamePattern, columnNamePattern);
        return handle;
      } catch (Throwable e) {
        closeSession(sessionHandle);
View Full Code Here


    try {
      Map<String, String> sessionConf = startSession();
      SessionHandle sessionHandle = cliService.openSession("", "", sessionConf);
      try {
        OperationHandle operationHandle = cliService.getCatalogs(sessionHandle);
        QueryHandle handle = saveOperationInfo(operationHandle, sessionHandle, sessionConf, "");
        LOG.trace("Retrieving catalogs");
        return handle;
      } catch (Throwable e) {
        closeSession(sessionHandle);
        throw e;
View Full Code Here

    try {
      Map<String, String> sessionConf = startSession();
      SessionHandle sessionHandle = cliService.openSession("", "", sessionConf);
      try {
        OperationHandle operationHandle = cliService.getSchemas(sessionHandle, catalog, schemaPattern);
        QueryHandle handle = saveOperationInfo(operationHandle, sessionHandle, sessionConf, "");
        LOG.trace("Retrieving schemas: catalog {}, schema {}", catalog, schemaPattern);
        return handle;
      } catch (Throwable e) {
        closeSession(sessionHandle);
        throw e;
View Full Code Here

      Map<String, String> sessionConf = startSession();
      SessionHandle sessionHandle = cliService.openSession("", "", sessionConf);
      try {
        OperationHandle operationHandle = cliService.getFunctions(sessionHandle, catalog,
                                                                  schemaPattern, functionNamePattern);
        QueryHandle handle = saveOperationInfo(operationHandle, sessionHandle, sessionConf, "");
        LOG.trace("Retrieving functions: catalog {}, schema {}, function {}",
                  catalog, schemaPattern, functionNamePattern);
        return handle;
      } catch (Throwable e) {
        closeSession(sessionHandle);
View Full Code Here

      Map<String, String> sessionConf = startSession();
      SessionHandle sessionHandle = cliService.openSession("", "", sessionConf);
      try {
        OperationHandle operationHandle = cliService.getTables(sessionHandle, catalog, schemaPattern,
                                                               tableNamePattern, tableTypes);
        QueryHandle handle = saveOperationInfo(operationHandle, sessionHandle, sessionConf, "");
        LOG.trace("Retrieving tables: catalog {}, schemaNamePattern {}, tableNamePattern {}, tableTypes {}",
                  catalog, schemaPattern, tableNamePattern, tableTypes);
        return handle;
      } catch (Throwable e) {
        closeSession(sessionHandle);
View Full Code Here

    try {
      Map<String, String> sessionConf = startSession();
      SessionHandle sessionHandle = cliService.openSession("", "", sessionConf);
      try {
        OperationHandle operationHandle = cliService.getTableTypes(sessionHandle);
        QueryHandle handle = saveOperationInfo(operationHandle, sessionHandle, sessionConf, "");
        LOG.trace("Retrieving table types");
        return handle;
      } catch (Throwable e) {
        closeSession(sessionHandle);
        throw e;
View Full Code Here

    try {
      Map<String, String> sessionConf = startSession();
      SessionHandle sessionHandle = cliService.openSession("", "", sessionConf);
      try {
        OperationHandle operationHandle = cliService.getTypeInfo(sessionHandle);
        QueryHandle handle = saveOperationInfo(operationHandle, sessionHandle, sessionConf, "");
        LOG.trace("Retrieving type info");
        return handle;
      } catch (Throwable e) {
        closeSession(sessionHandle);
        throw e;
View Full Code Here

      Map<String, String> sessionConf = startSession();
      // It looks like the username and password below is not used when security is disabled in Hive Server2.
      SessionHandle sessionHandle = cliService.openSession("", "", sessionConf);
      try {
        OperationHandle operationHandle = doExecute(sessionHandle, statement);
        QueryHandle handle = saveOperationInfo(operationHandle, sessionHandle, sessionConf, statement);
        LOG.trace("Executing statement: {} with handle {}", statement, handle);
        return handle;
      } catch (Throwable e) {
        closeSession(sessionHandle);
        throw e;
View Full Code Here

   * @param statement SQL statement executed with the call.
   * @return {@link QueryHandle} that represents the Hive operation being run.
   */
  protected QueryHandle saveOperationInfo(OperationHandle operationHandle, SessionHandle sessionHandle,
                                     Map<String, String> sessionConf, String statement) {
    QueryHandle handle = QueryHandle.generate();
    activeHandleCache.put(handle, new OperationInfo(sessionHandle, operationHandle, sessionConf, statement));
    return handle;
  }
View Full Code Here

      LOG.debug("Running create statement for dataset {} with row scannable {} - {}",
                datasetName,
                dataset.getClass().getName(),
                createStatement);

      QueryHandle handle = exploreService.execute(createStatement);
      JsonObject json = new JsonObject();
      json.addProperty("handle", handle.getHandle());
      responder.sendJson(HttpResponseStatus.OK, json);
    } catch (Throwable e) {
      LOG.error("Got exception:", e);
      responder.sendError(HttpResponseStatus.INTERNAL_SERVER_ERROR, e.getMessage());
    }
View Full Code Here

TOP

Related Classes of co.cask.cdap.proto.QueryHandle

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.