protected void renewOrRemoveExpiredTokens() {
    long now = System.currentTimeMillis();
    for (DelegationTokenIdentifier id : tokenStore.getAllDelegationTokenIdentifiers()) {
      if (now > id.getMaxDate()) {
        LOGGER.info("Expiry Thread removing expired token: " + id);
        this.tokenStore.removeToken(id); // no need to look at token info
      } else {
        // get token info to check renew date
        try {
          renewIfRequired(id, tokenStore.getToken(id));
        } catch (InvalidToken e) {
          LOGGER.warn("Failed to renew token: " + id, e);
        }
      }
    }
  }
Remove expired tokens. Replaces logic in {@link AbstractDelegationTokenSecretManager}
that cannot be reused due to private method access. Logic here can more efficiently
deal with external token store by only loading into memory the minimum data needed.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/security/TokenStoreDelegationTokenSecretManager.java