use of org.apache.hive.service.rpc.thrift.TCancelDelegationTokenResp in project hive by apache.
the class ThriftCLIService method CancelDelegationToken.
@Override
public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req) throws TException {
TCancelDelegationTokenResp resp = new TCancelDelegationTokenResp();
if (hiveAuthFactory == null || !hiveAuthFactory.isSASLKerberosUser()) {
resp.setStatus(unsecureTokenErrorStatus());
} else {
try {
cliService.cancelDelegationToken(new SessionHandle(req.getSessionHandle()), hiveAuthFactory, req.getDelegationToken());
resp.setStatus(OK_STATUS);
} catch (HiveSQLException e) {
LOG.error("Error canceling delegation token", e);
resp.setStatus(HiveSQLException.toTStatus(e));
}
}
return resp;
}
use of org.apache.hive.service.rpc.thrift.TCancelDelegationTokenResp 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);
}
}
use of org.apache.hive.service.rpc.thrift.TCancelDelegationTokenResp 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);
}
}
Aggregations