sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] rombert commented on a change in pull request #5: SLING-7544 - improving optimized alias lookup to not block during int…
Date Wed, 25 Apr 2018 15:12:05 GMT
rombert commented on a change in pull request #5: SLING-7544 - improving optimized alias lookup
to not block during int…
URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/5#discussion_r184093639
 
 

 ##########
 File path: src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
 ##########
 @@ -189,10 +199,16 @@ protected void doInit() {
 
             final Map<String, List<MapEntry>> newResolveMapsMap = new ConcurrentHashMap<>();
 
+            isAliasMapInitialized = false;
             //optimization made in SLING-2521
             if (this.factory.isOptimizeAliasResolutionEnabled()) {
-                final Map<String, Map<String, String>> aliasMap = this.loadAliases(resolver);
-                this.aliasMap = aliasMap;
+            	aliasTraversal = new Thread(new Runnable(){
+    				public void run() {
+    					aliasMap = loadAliases(resolver);
+    					isAliasMapInitialized = true;
+    					}
+    				});
+            	aliasTraversal.start();
 
 Review comment:
   Are we missing an `else` block here which loads the aliases in the main thread?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

Mime
View raw message