@Override public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws TException { TCancelOperationResp resp = new TCancelOperationResp(); try { cliService.cancelOperation(new OperationHandle(req.getOperationHandle())); resp.setStatus(OK_STATUS); } catch (Exception e) { LOG.warn("Error cancelling operation: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; }
/** * Cancel a running Hive operation. After the operation moves into a {@link QueryStatus.OpStatus#CANCELED}, * {@link #close(QueryHandle)} needs to be called to release resources. * * @param handle handle returned by {@link Explore#execute(NamespaceId, String)}. * @throws ExploreException on any error cancelling operation. * @throws HandleNotFoundException when handle is not found. * @throws SQLException if there are errors in the SQL statement. */ void cancelInternal(QueryHandle handle) throws ExploreException, HandleNotFoundException, SQLException { try { InactiveOperationInfo inactiveOperationInfo = inactiveHandleCache.getIfPresent(handle); if (inactiveOperationInfo != null) { // Operation has been made inactive, so no point in cancelling it. LOG.trace("Not running cancel for inactive handle {}", handle); return; } LOG.trace("Cancelling operation {}", handle); cliService.cancelOperation(getOperationHandle(handle)); } catch (HiveSQLException e) { throw getSqlException(e); } }
/** * Cancel a running Hive operation. After the operation moves into a {@link QueryStatus.OpStatus#CANCELED}, * {@link #close(QueryHandle)} needs to be called to release resources. * * @param handle handle returned by {@link Explore#execute(NamespaceId, String)}. * @throws ExploreException on any error cancelling operation. * @throws HandleNotFoundException when handle is not found. * @throws SQLException if there are errors in the SQL statement. */ void cancelInternal(QueryHandle handle) throws ExploreException, HandleNotFoundException, SQLException { try { InactiveOperationInfo inactiveOperationInfo = inactiveHandleCache.getIfPresent(handle); if (inactiveOperationInfo != null) { // Operation has been made inactive, so no point in cancelling it. LOG.trace("Not running cancel for inactive handle {}", handle); return; } LOG.trace("Cancelling operation {}", handle); cliService.cancelOperation(getOperationHandle(handle)); } catch (HiveSQLException e) { throw getSqlException(e); } }
@Override public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws TException { TCancelOperationResp resp = new TCancelOperationResp(); try { cliService.cancelOperation(new OperationHandle(req.getOperationHandle())); resp.setStatus(OK_STATUS); } catch (Exception e) { LOG.warn("Error cancelling operation: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; }
@Override public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws TException { TCancelOperationResp resp = new TCancelOperationResp(); try { cliService.cancelOperation(new OperationHandle(req.getOperationHandle())); resp.setStatus(OK_STATUS); } catch (Exception e) { LOG.warn("Error cancelling operation: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; }
@Override public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws TException { TCancelOperationResp resp = new TCancelOperationResp(); try { cliService.cancelOperation(new OperationHandle(req.getOperationHandle())); resp.setStatus(OK_STATUS); } catch (Exception e) { LOG.warn("Error cancelling operation: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; }
@Override public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws TException { TCancelOperationResp resp = new TCancelOperationResp(); try { cliService.cancelOperation(new OperationHandle(req.getOperationHandle())); resp.setStatus(OK_STATUS); } catch (Exception e) { LOG.warn("Error cancelling operation: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; }
@Override public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws TException { TCancelOperationResp resp = new TCancelOperationResp(); try { cliService.cancelOperation(new OperationHandle(req.getOperationHandle())); resp.setStatus(OK_STATUS); } catch (Exception e) { LOG.warn("Error cancelling operation: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; }