use of org.apache.hive.service.rpc.thrift.TCancelOperationResp in project hive by apache.
the class ThriftCLIServiceClient method cancelOperation.
/* (non-Javadoc)
* @see org.apache.hive.service.cli.ICLIService#cancelOperation(org.apache.hive.service.cli.OperationHandle)
*/
@Override
public void cancelOperation(OperationHandle opHandle) throws HiveSQLException {
try {
TCancelOperationReq req = new TCancelOperationReq(opHandle.toTOperationHandle());
TCancelOperationResp resp = cliService.CancelOperation(req);
checkStatus(resp.getStatus());
} catch (HiveSQLException e) {
throw e;
} catch (Exception e) {
throw new HiveSQLException(e);
}
}
use of org.apache.hive.service.rpc.thrift.TCancelOperationResp in project hive by apache.
the class HiveStatement method cancel.
/*
* (non-Javadoc)
*
* @see java.sql.Statement#cancel()
*/
@Override
public void cancel() throws SQLException {
checkConnection("cancel");
if (isCancelled) {
return;
}
try {
if (stmtHandle != null) {
TCancelOperationReq cancelReq = new TCancelOperationReq(stmtHandle);
TCancelOperationResp cancelResp = client.CancelOperation(cancelReq);
Utils.verifySuccessWithInfo(cancelResp.getStatus());
}
} catch (SQLException e) {
throw e;
} catch (Exception e) {
throw new SQLException(e.toString(), "08S01", e);
}
isCancelled = true;
}
use of org.apache.hive.service.rpc.thrift.TCancelOperationResp in project hive by apache.
the class ThriftCLIService method CancelOperation.
@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;
}
Aggregations