Search in sources :

Example 1 with CancelDelegationTokenRequest

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);
    }
}
Also used : CancelDelegationTokenRequest(org.apache.hadoop.mapreduce.v2.api.protocolrecords.CancelDelegationTokenRequest) MRClientProtocol(org.apache.hadoop.mapreduce.v2.api.MRClientProtocol)

Aggregations

MRClientProtocol (org.apache.hadoop.mapreduce.v2.api.MRClientProtocol)1 CancelDelegationTokenRequest (org.apache.hadoop.mapreduce.v2.api.protocolrecords.CancelDelegationTokenRequest)1