use of org.apache.hadoop.mapreduce.v2.api.protocolrecords.CancelDelegationTokenRequest in project hadoop by apache.
the class MRDelegationTokenRenewer method cancel.
@Override
public void cancel(Token<?> token, Configuration conf) throws IOException, InterruptedException {
org.apache.hadoop.yarn.api.records.Token dToken = org.apache.hadoop.yarn.api.records.Token.newInstance(token.getIdentifier(), token.getKind().toString(), token.getPassword(), token.getService().toString());
MRClientProtocol histProxy = instantiateHistoryProxy(conf, SecurityUtil.getTokenServiceAddr(token));
try {
CancelDelegationTokenRequest request = Records.newRecord(CancelDelegationTokenRequest.class);
request.setDelegationToken(dToken);
histProxy.cancelDelegationToken(request);
} finally {
stopHistoryProxy(histProxy);
}
}
Aggregations