Search in sources :

Example 1 with TCancelOperationReq

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);
    }
}
Also used : TCancelOperationReq(org.apache.hive.service.rpc.thrift.TCancelOperationReq) TCancelOperationResp(org.apache.hive.service.rpc.thrift.TCancelOperationResp) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) TException(org.apache.thrift.TException)

Example 2 with TCancelOperationReq

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;
}
Also used : TCancelOperationReq(org.apache.hive.service.rpc.thrift.TCancelOperationReq) TCancelOperationResp(org.apache.hive.service.rpc.thrift.TCancelOperationResp) SQLException(java.sql.SQLException) SQLFeatureNotSupportedException(java.sql.SQLFeatureNotSupportedException) SQLTimeoutException(java.sql.SQLTimeoutException) SQLException(java.sql.SQLException) TException(org.apache.thrift.TException)

Aggregations

TCancelOperationReq (org.apache.hive.service.rpc.thrift.TCancelOperationReq)2 TCancelOperationResp (org.apache.hive.service.rpc.thrift.TCancelOperationResp)2 TException (org.apache.thrift.TException)2 SQLException (java.sql.SQLException)1 SQLFeatureNotSupportedException (java.sql.SQLFeatureNotSupportedException)1 SQLTimeoutException (java.sql.SQLTimeoutException)1 HiveSQLException (org.apache.hive.service.cli.HiveSQLException)1