1. Token and DelegationTokenIdentifier both have a toString method. Can we use those instead of new stringifyToken? toString in the Token will need a fix not to write the password.
this is client side. On client side DTIdentifier is just a binary blob, so we cannot use toString().
2. In HftpFileSystem.java
+ delegationToken =
+ (Token<DelegationTokenIdentifier>) getDelegationToken(null);
If renewer is passed as null in getDelegationToken, the renewer thread won't be able to renew it.
well, looks like it is added here in GetDelegationTokenServlet:
final String renewerFinal = (renewer == null) ?
req.getUserPrincipal().getName() : renewer;
3. In GetDelegationTokenServlet, the new delegation token may be returned as null. We should check for null.
4. minor: I noticed similar code at a few places; is it possible to abstract it into a method, which takes scheme, hostname and port and constructs the uri?
+ sb = new StringBuilder("hdfs://");