private Token<LlapTokenIdentifier> generateToken(GetTokenRequestProto request, boolean isSigningRequired)
      throws IOException {
    Token<LlapTokenIdentifier> token =
        secretManager.createLlapToken(request.hasAppId() ? request.getAppId() : null, null, isSigningRequired);
    tokens.add(new TokenWrapper(token));

    LOG.info("Added new token: {}, #tokens: {}", token, tokens.size());
    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