code: public static boolean hasHDFSDelegationToken() throws Exception {
  		UserGroupInformation loginUser = UserGroupInformation.getCurrentUser();
  		Collection<Token<? extends TokenIdentifier>> usrTok = loginUser.getTokens();
  		for (Token<? extends TokenIdentifier> token : usrTok) {
  			if (token.getKind().equals(HDFS_DELEGATION_TOKEN_KIND)) {
  				return true;
  			}
  		}
  		return false;
  	}
docs: Indicates whether the current user has an HDFS delegation token.