You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/03/06 05:00:23 UTC

[GitHub] [helix] pkuwm commented on a change in pull request #863: Make ZkCacheBaseDataAccessor and ZkHelixPropertyStore realm-aware

pkuwm commented on a change in pull request #863: Make ZkCacheBaseDataAccessor and ZkHelixPropertyStore realm-aware
URL: https://github.com/apache/helix/pull/863#discussion_r388564073
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/manager/zk/ZkCacheBaseDataAccessor.java
 ##########
 @@ -58,7 +61,15 @@
   protected ZkCallbackCache<T> _zkCache;
 
   final ZkBaseDataAccessor<T> _baseAccessor;
-  final Map<String, Cache<T>> _cacheMap;
+
+  // TODO: need to make sure no overlap between wtCachePaths and zkCachePaths
+  // TreeMap key is ordered by key string length, so more general (i.e. short) prefix
+  // comes first
+  final Map<String, Cache<T>> _cacheMap = new TreeMap<>((o1, o2) -> {
+    int len1 = o1.split("/").length;
+    int len2 = o2.split("/").length;
 
 Review comment:
   static constant for "/" to reduce objects created?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org