use of org.apache.hive.service.rpc.thrift.TCancelOperationReq 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.TCancelOperationReq 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;
}
Aggregations