@Override
  public boolean invalidateCache(String userName, String roleName) {
    if (userName != null) {
      if (userCache.getIfPresent(userName) != null) {
        Set<String> roleSet = userCache.getIfPresent(userName).getRoleSet();
        if (!roleSet.isEmpty()) {
          roleCache.invalidateAll(roleSet);
        }
        userCache.invalidate(userName);
      }
      if (userCache.getIfPresent(userName) != null) {
        LOGGER.error("datanode cache initialization failed");
        return false;
      }
    }
    if (roleName != null) {
      if (roleCache.getIfPresent(roleName) != null) {
        roleCache.invalidate(roleName);
      }
      if (roleCache.getIfPresent(roleName) != null) {
        LOGGER.error("datanode cache initialization failed");
        return false;
      }
    }
    return true;
  }
Initialize user and role cache information.

<p>If the permission information of the role changes, only the role cache information is
cleared. During permission checking, if the role belongs to a user, the user will be
initialized.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/auth/BasicAuthorityCache.java