Search in sources :

Example 1 with TCancelDelegationTokenReq

use of org.apache.hive.service.rpc.thrift.TCancelDelegationTokenReq in project hive by apache.

the class ThriftCLIServiceClient method cancelDelegationToken.

@Override
public void cancelDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, String tokenStr) throws HiveSQLException {
    TCancelDelegationTokenReq cancelReq = new TCancelDelegationTokenReq(sessionHandle.toTSessionHandle(), tokenStr);
    try {
        TCancelDelegationTokenResp cancelResp = cliService.CancelDelegationToken(cancelReq);
        checkStatus(cancelResp.getStatus());
        return;
    } catch (TException e) {
        throw new HiveSQLException(e);
    }
}
Also used : TException(org.apache.thrift.TException) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) TCancelDelegationTokenReq(org.apache.hive.service.rpc.thrift.TCancelDelegationTokenReq) TCancelDelegationTokenResp(org.apache.hive.service.rpc.thrift.TCancelDelegationTokenResp)

Example 2 with TCancelDelegationTokenReq

use of org.apache.hive.service.rpc.thrift.TCancelDelegationTokenReq in project hive by apache.

the class HiveConnection method cancelDelegationToken.

public void cancelDelegationToken(String tokenStr) throws SQLException {
    TCancelDelegationTokenReq cancelReq = new TCancelDelegationTokenReq(sessHandle, tokenStr);
    try {
        TCancelDelegationTokenResp cancelResp = client.CancelDelegationToken(cancelReq);
        Utils.verifySuccess(cancelResp.getStatus());
        return;
    } catch (TException e) {
        throw new SQLException("Could not cancel token: " + e.getMessage(), " 08S01", e);
    }
}
Also used : TException(org.apache.thrift.TException) SQLException(java.sql.SQLException) TCancelDelegationTokenReq(org.apache.hive.service.rpc.thrift.TCancelDelegationTokenReq) TCancelDelegationTokenResp(org.apache.hive.service.rpc.thrift.TCancelDelegationTokenResp)

Aggregations

TCancelDelegationTokenReq (org.apache.hive.service.rpc.thrift.TCancelDelegationTokenReq)2 TCancelDelegationTokenResp (org.apache.hive.service.rpc.thrift.TCancelDelegationTokenResp)2 TException (org.apache.thrift.TException)2 SQLException (java.sql.SQLException)1 HiveSQLException (org.apache.hive.service.cli.HiveSQLException)1