risdenk commented on a change in pull request #205: KNOX-2134 - Add caching to
ZookeeperRemoteAliasService
URL: https://github.com/apache/knox/pull/205#discussion_r349758387
##########
File path:
gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/ZookeeperRemoteAliasService.java
##########
@@ -199,12 +205,17 @@ public void addAliasForCluster(final String clusterName,
"Failed to store alias %s for cluster %s in remote registry",
alias,
clusterName));
}
+ } else {
+ // Add it to the local cache only
+ Map<String, String> clusterAliases =
aliasCache.computeIfAbsent(clusterName, m -> new ConcurrentHashMap<>());
Review comment:
These 2 lines are used a few times. Might help to make it a "add to alias
cache" method.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services