@Override
  public Token<LlapTokenIdentifier> getToken(GetTokenRequestProto request, boolean isSigningRequired)
      throws IOException {
    Token<LlapTokenIdentifier> token = tokens.isEmpty() ? null : tokens.get(0).realToken;

    if (token == null) {
      token = generateToken(request, isSigningRequired);
    } else {
      LOG.debug("Returning already existing token: {}", token);
    }

    return token;
  }
Convenience wrapper for llap tokens, that decodes max lifetime only once on adding and maintains expiration time.
llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/DefaultLlapTokenManager.java