Search in sources :

Example 11 with OperationManager

use of org.apache.hive.service.cli.operation.OperationManager in project hive by apache.

the class HiveSessionImpl method getTables.

@Override
public OperationHandle getTables(String catalogName, String schemaName, String tableName, List<String> tableTypes) throws HiveSQLException {
    acquire(true, true);
    OperationManager operationManager = getOperationManager();
    MetadataOperation operation = operationManager.newGetTablesOperation(getSession(), catalogName, schemaName, tableName, tableTypes);
    OperationHandle opHandle = operation.getHandle();
    try {
        addOpHandle(opHandle);
        operation.run();
        return opHandle;
    } catch (HiveSQLException e) {
        removeOpHandle(opHandle);
        operationManager.closeOperation(opHandle);
        throw e;
    } finally {
        release(true, true);
    }
}
Also used : MetadataOperation(org.apache.hive.service.cli.operation.MetadataOperation) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) OperationManager(org.apache.hive.service.cli.operation.OperationManager) OperationHandle(org.apache.hive.service.cli.OperationHandle)

Example 12 with OperationManager

use of org.apache.hive.service.cli.operation.OperationManager in project hive by apache.

the class HiveSessionImpl method getSchemas.

@Override
public OperationHandle getSchemas(String catalogName, String schemaName) throws HiveSQLException {
    acquire(true, true);
    OperationManager operationManager = getOperationManager();
    GetSchemasOperation operation = operationManager.newGetSchemasOperation(getSession(), catalogName, schemaName);
    OperationHandle opHandle = operation.getHandle();
    try {
        addOpHandle(opHandle);
        operation.run();
        return opHandle;
    } catch (HiveSQLException e) {
        removeOpHandle(opHandle);
        operationManager.closeOperation(opHandle);
        throw e;
    } finally {
        release(true, true);
    }
}
Also used : GetSchemasOperation(org.apache.hive.service.cli.operation.GetSchemasOperation) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) OperationManager(org.apache.hive.service.cli.operation.OperationManager) OperationHandle(org.apache.hive.service.cli.OperationHandle)

Example 13 with OperationManager

use of org.apache.hive.service.cli.operation.OperationManager in project hive by apache.

the class HiveSessionImpl method getTypeInfo.

@Override
public OperationHandle getTypeInfo() throws HiveSQLException {
    acquire(true, true);
    OperationManager operationManager = getOperationManager();
    GetTypeInfoOperation operation = operationManager.newGetTypeInfoOperation(getSession());
    OperationHandle opHandle = operation.getHandle();
    try {
        addOpHandle(opHandle);
        operation.run();
        return opHandle;
    } catch (HiveSQLException e) {
        removeOpHandle(opHandle);
        operationManager.closeOperation(opHandle);
        throw e;
    } finally {
        release(true, true);
    }
}
Also used : GetTypeInfoOperation(org.apache.hive.service.cli.operation.GetTypeInfoOperation) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) OperationManager(org.apache.hive.service.cli.operation.OperationManager) OperationHandle(org.apache.hive.service.cli.OperationHandle)

Example 14 with OperationManager

use of org.apache.hive.service.cli.operation.OperationManager in project hive by apache.

the class QueryProfileServlet method doGet.

@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    String opId = (String) request.getParameter("operationId");
    ServletContext ctx = getServletContext();
    SessionManager sessionManager = (SessionManager) ctx.getAttribute("hive.sm");
    OperationManager opManager = sessionManager.getOperationManager();
    QueryInfo queryInfo = opManager.getQueryInfo(opId);
    HiveConf hiveConf = opManager.getHiveConf();
    if (queryInfo == null) {
        LOG.debug("No display object found for operation {} ", opId);
        return;
    }
    new QueryProfileTmpl().render(response.getWriter(), queryInfo, hiveConf);
}
Also used : SessionManager(org.apache.hive.service.cli.session.SessionManager) QueryProfileTmpl(org.apache.hive.tmpl.QueryProfileTmpl) ServletContext(javax.servlet.ServletContext) HiveConf(org.apache.hadoop.hive.conf.HiveConf) OperationManager(org.apache.hive.service.cli.operation.OperationManager) QueryInfo(org.apache.hadoop.hive.ql.QueryInfo)

Aggregations

OperationManager (org.apache.hive.service.cli.operation.OperationManager)14 HiveSQLException (org.apache.hive.service.cli.HiveSQLException)12 OperationHandle (org.apache.hive.service.cli.OperationHandle)12 SessionHandle (org.apache.hive.service.cli.SessionHandle)3 Test (org.junit.Test)3 BrokenBarrierException (java.util.concurrent.BrokenBarrierException)2 CyclicBarrier (java.util.concurrent.CyclicBarrier)2 TimeoutException (java.util.concurrent.TimeoutException)2 HiveConf (org.apache.hadoop.hive.conf.HiveConf)2 HashMap (java.util.HashMap)1 ServletContext (javax.servlet.ServletContext)1 IMetaStoreClient (org.apache.hadoop.hive.metastore.IMetaStoreClient)1 QueryInfo (org.apache.hadoop.hive.ql.QueryInfo)1 ExecuteStatementOperation (org.apache.hive.service.cli.operation.ExecuteStatementOperation)1 GetCatalogsOperation (org.apache.hive.service.cli.operation.GetCatalogsOperation)1 GetColumnsOperation (org.apache.hive.service.cli.operation.GetColumnsOperation)1 GetCrossReferenceOperation (org.apache.hive.service.cli.operation.GetCrossReferenceOperation)1 GetFunctionsOperation (org.apache.hive.service.cli.operation.GetFunctionsOperation)1 GetPrimaryKeysOperation (org.apache.hive.service.cli.operation.GetPrimaryKeysOperation)1 GetSchemasOperation (org.apache.hive.service.cli.operation.GetSchemasOperation)1