hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yongjun Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HDFS-10211) Add more info to DelegationTokenIdentifier#toString for better supportability
Date Thu, 24 Mar 2016 21:45:25 GMT
Yongjun Zhang created HDFS-10211:

             Summary: Add more info to DelegationTokenIdentifier#toString for better supportability
                 Key: HDFS-10211
                 URL: https://issues.apache.org/jira/browse/HDFS-10211
             Project: Hadoop HDFS
          Issue Type: Improvement
            Reporter: Yongjun Zhang
            Assignee: Yongjun Zhang

Base class {{AbstractDelegationTokenIdentifier}} has the following implementation of {{toString()}}
  public String toString() {
    StringBuilder buffer = new StringBuilder();
        .append("owner=" + owner + ", renewer=" + renewer + ", realUser="
            + realUser + ", issueDate=" + issueDate + ", maxDate=" + maxDate
            + ", sequenceNumber=" + sequenceNumber + ", masterKeyId="
            + masterKeyId);
    return buffer.toString();

However, derived class 

has the following implementation that overrides the base class above:

  public String toString() {
    return getKind() + " token " + getSequenceNumber()
        + " for " + getUser().getShortUserName();

And when exception is thrown because of token expiration or other reason:
    if (info.getRenewDate() < Time.now()) {
      throw new InvalidToken("token (" + identifier.toString() + ") is expired");
The exception doesn't show the detailed information about the token, like the base class'
toString() method returns.

Creating this jira to change the 
 implementation to include all the info about the token, as included by the base class.

This change would help supportability, at the expense of printing a little more information
to the log. I hope no code really depends on the output string. 

This message was sent by Atlassian JIRA

View raw message