HADOOP-6905. Better logging messages when a delegation token is invalid. Contributed by Kan Zhang.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@986172 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4c940af714
commit
9950db1817
|
@ -117,6 +117,9 @@ Trunk (unreleased changes)
|
|||
throw IOException rather than RuntimeException when there is an IO error
|
||||
fetching the next file. (hairong)
|
||||
|
||||
HADOOP-6905. Better logging messages when a delegation token is invalid.
|
||||
(Kan Zhang via jghoman)
|
||||
|
||||
OPTIMIZATIONS
|
||||
|
||||
BUG FIXES
|
||||
|
|
|
@ -198,11 +198,12 @@ extends AbstractDelegationTokenIdentifier>
|
|||
throws InvalidToken {
|
||||
DelegationTokenInformation info = currentTokens.get(identifier);
|
||||
if (info == null) {
|
||||
throw new InvalidToken("token is expired or doesn't exist");
|
||||
throw new InvalidToken("token (" + identifier.toString()
|
||||
+ ") can't be found in cache");
|
||||
}
|
||||
long now = System.currentTimeMillis();
|
||||
if (info.getRenewDate() < now) {
|
||||
throw new InvalidToken("token is expired");
|
||||
throw new InvalidToken("token (" + identifier.toString() + ") is expired");
|
||||
}
|
||||
return info.getPassword();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue