From 2dd960de983a30bf0d9ee957bdb09f825f9d40a3 Mon Sep 17 00:00:00 2001 From: Kihwal Lee Date: Tue, 6 Feb 2018 15:33:18 -0600 Subject: [PATCH] HADOOP-15212. Add independent secret manager method for logging expired tokens. Contributed by Daryn Sharp. --- .../delegation/AbstractDelegationTokenSecretManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java index f06681b9f5e..7593b4e57dd 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java @@ -22,6 +22,7 @@ import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; import java.security.MessageDigest; +import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -627,6 +628,11 @@ extends AbstractDelegationTokenIdentifier> } } // don't hold lock on 'this' to avoid edit log updates blocking token ops + logExpireTokens(expiredTokens); + } + + protected void logExpireTokens( + Collection expiredTokens) throws IOException { for (TokenIdent ident : expiredTokens) { logExpireToken(ident); LOG.info("Removing expired token " + formatTokenId(ident));