Search in sources :

Example 1 with TRenewDelegationTokenReq

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

the class HiveConnection method renewDelegationToken.

public void renewDelegationToken(String tokenStr) throws SQLException {
    TRenewDelegationTokenReq cancelReq = new TRenewDelegationTokenReq(sessHandle, tokenStr);
    try {
        TRenewDelegationTokenResp renewResp = client.RenewDelegationToken(cancelReq);
        Utils.verifySuccess(renewResp.getStatus());
        return;
    } catch (TException e) {
        throw new SQLException("Could not renew token: " + e.getMessage(), " 08S01", e);
    }
}
Also used : TException(org.apache.thrift.TException) SQLException(java.sql.SQLException) TRenewDelegationTokenResp(org.apache.hive.service.rpc.thrift.TRenewDelegationTokenResp) TRenewDelegationTokenReq(org.apache.hive.service.rpc.thrift.TRenewDelegationTokenReq)

Example 2 with TRenewDelegationTokenReq

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

the class ThriftCLIServiceClient method renewDelegationToken.

@Override
public void renewDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, String tokenStr) throws HiveSQLException {
    TRenewDelegationTokenReq cancelReq = new TRenewDelegationTokenReq(sessionHandle.toTSessionHandle(), tokenStr);
    try {
        TRenewDelegationTokenResp renewResp = cliService.RenewDelegationToken(cancelReq);
        checkStatus(renewResp.getStatus());
        return;
    } catch (Exception e) {
        throw new HiveSQLException(e);
    }
}
Also used : TRenewDelegationTokenResp(org.apache.hive.service.rpc.thrift.TRenewDelegationTokenResp) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) TRenewDelegationTokenReq(org.apache.hive.service.rpc.thrift.TRenewDelegationTokenReq) HiveSQLException(org.apache.hive.service.cli.HiveSQLException) TException(org.apache.thrift.TException)

Aggregations

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