HADOOP-15212. Add independent secret manager method for logging expired tokens. Contributed by Daryn Sharp.
(cherry picked from commit 2dd960de98
)
This commit is contained in:
parent
615bd15072
commit
d436c403b2
|
@ -22,6 +22,7 @@ import java.io.ByteArrayInputStream;
|
||||||
import java.io.DataInputStream;
|
import java.io.DataInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -627,6 +628,11 @@ extends AbstractDelegationTokenIdentifier>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// don't hold lock on 'this' to avoid edit log updates blocking token ops
|
// don't hold lock on 'this' to avoid edit log updates blocking token ops
|
||||||
|
logExpireTokens(expiredTokens);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void logExpireTokens(
|
||||||
|
Collection<TokenIdent> expiredTokens) throws IOException {
|
||||||
for (TokenIdent ident : expiredTokens) {
|
for (TokenIdent ident : expiredTokens) {
|
||||||
logExpireToken(ident);
|
logExpireToken(ident);
|
||||||
LOG.info("Removing expired token " + formatTokenId(ident));
|
LOG.info("Removing expired token " + formatTokenId(ident));
|
||||||
|
|
Loading…
Reference in New Issue