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);
}
}
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);
}
}
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);
}
}
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);
}
Aggregations