Search in sources :

Example 1 with TCancelOperationResp

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

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

Example 3 with TCancelOperationResp

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;
}
Also used : TCancelOperationResp(org.apache.hive.service.rpc.thrift.TCancelOperationResp) OperationHandle(org.apache.hive.service.cli.OperationHandle) LoginException(javax.security.auth.login.LoginException) ServiceException(org.apache.hive.service.ServiceException) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) TException(org.apache.thrift.TException) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException)

Aggregations

TCancelOperationResp (org.apache.hive.service.rpc.thrift.TCancelOperationResp)3 TException (org.apache.thrift.TException)3 HiveSQLException (org.apache.hive.service.cli.HiveSQLException)2 TCancelOperationReq (org.apache.hive.service.rpc.thrift.TCancelOperationReq)2 IOException (java.io.IOException)1 UnknownHostException (java.net.UnknownHostException)1 SQLException (java.sql.SQLException)1 SQLFeatureNotSupportedException (java.sql.SQLFeatureNotSupportedException)1 SQLTimeoutException (java.sql.SQLTimeoutException)1 LoginException (javax.security.auth.login.LoginException)1 ServiceException (org.apache.hive.service.ServiceException)1 OperationHandle (org.apache.hive.service.cli.OperationHandle)1