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