[ 
https://issues.apache.org/jira/browse/SLING-7544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16408350#comment-16408350
 ] 

ASF GitHub Bot commented on SLING-7544:
---------------------------------------

catholicon 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_r176186913
 
 

 ##########
 File path: 
src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
 ##########
 @@ -1027,12 +1044,28 @@ private boolean addEntry(final Map<String, 
List<MapEntry>> entryMap, final Strin
      */
     private Map<String, Map<String, String>> loadAliases(final 
ResourceResolver resolver) {
         final Map<String, Map<String, String>> map = new ConcurrentHashMap<>();
-        final String queryString = "SELECT sling:alias FROM nt:base WHERE 
sling:alias IS NOT NULL";
-        final Iterator<Resource> i = resolver.findResources(queryString, 
"sql");
-        while (i.hasNext()) {
-            final Resource resource = i.next();
-            loadAlias(resource, map);
-        }
+        String queryString = "SELECT sling:alias FROM nt:base WHERE 
sling:alias IS NOT NULL";
+               if (this.factory.isForceNoAliasTraversal()) {
+                       queryString += " option(traversal fail)";
 
 Review comment:
   Quick note as @DominikSuess pinged me offline. I wonder if it might an 
interesting idea to do a `EXPLAIN SELECT sling:alias .... ` first and see that 
`/* travers` doesn't show up in the plan.
   
   That should work across oak versions afaict (I just tested with oak 1.2.2)

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


> Make optimized alias lookup non-blocking
> ----------------------------------------
>
>                 Key: SLING-7544
>                 URL: https://issues.apache.org/jira/browse/SLING-7544
>             Project: Sling
>          Issue Type: Improvement
>          Components: ResourceResolver
>    Affects Versions: Resource Resolver 1.5.36
>            Reporter: Dominik Süß
>            Priority: Major
>
> The implementation of optimized alias lookup as introduced with SLING-2521 
> blocks CommonResourceResolver activation while loading aliases to fillup the 
> aliasmap. In case a corresponding index is not present yet this can lead to 
> full tree traversal while indexing is doing the same in the background.
> The proposed improvements are:
> * making loading of the aliasmap happen asynchronously
> * only use optimized handling as soon as aliasmap is built
> * wait for non traversal index (optional - forced by default, can be turned 
> off for small datasets)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to