From dev-return-87615-archive-asf-public=cust-asf.ponee.io@sling.apache.org Wed Mar 21 19:13:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 743CA18067E for ; Wed, 21 Mar 2018 19:13:05 +0100 (CET) Received: (qmail 82350 invoked by uid 500); 21 Mar 2018 18:13:04 -0000 Mailing-List: contact dev-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list dev@sling.apache.org Received: (qmail 82334 invoked by uid 99); 21 Mar 2018 18:13:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Mar 2018 18:13:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 9F4C3C04BF for ; Wed, 21 Mar 2018 18:13:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id OqAjAtAvdyzi for ; Wed, 21 Mar 2018 18:13:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 8A22B5F2A8 for ; Wed, 21 Mar 2018 18:13:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 91711E0CE2 for ; Wed, 21 Mar 2018 18:13:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4328D214B9 for ; Wed, 21 Mar 2018 18:13:00 +0000 (UTC) Date: Wed, 21 Mar 2018 18:13:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@sling.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SLING-7544) Make optimized alias lookup non-blocking MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SLING-7544?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1640= 8348#comment-16408348 ]=20 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=E2=80=A6 URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull= /5#discussion_r176186913 =20 =20 ########## File path: src/main/java/org/apache/sling/resourceresolver/impl/mapping/Ma= pEntries.java ########## @@ -1027,12 +1044,28 @@ private boolean addEntry(final Map> entryMap, final Strin */ private Map> loadAliases(final ResourceRes= olver resolver) { final Map> map =3D new ConcurrentHashM= ap<>(); - final String queryString =3D "SELECT sling:alias FROM nt:base WHER= E sling:alias IS NOT NULL"; - final Iterator i =3D resolver.findResources(queryString,= "sql"); - while (i.hasNext()) { - final Resource resource =3D i.next(); - loadAlias(resource, map); - } + String queryString =3D "SELECT sling:alias FROM nt:base WHERE slin= g:alias IS NOT NULL"; +=09=09if (this.factory.isForceNoAliasTraversal()) { +=09=09=09queryString +=3D " option(traversal fail)"; =20 Review comment: Quick note as @DominikSuess pinged me offline. I wonder if it might an i= nteresting idea to do a {{EXPLAIN SELECT sling:alias .... }} first and see = that {{/\* travers}} doesn't show up in the plan. =20 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. =20 For queries about this service, please contact Infrastructure at: users@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=C3=BC=C3=9F > Priority: Major > > The implementation of optimized alias lookup as introduced with=C2=A0SLIN= G-2521 blocks=C2=A0CommonResourceResolver=C2=A0activation while loading ali= ases to fillup the aliasmap. In case a corresponding index is not present y= et 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=C2=A0use optimized handling as soon as aliasmap is built > * wait for non traversal index (optional - forced by default, can be turn= ed off for small datasets) -- This message was sent by Atlassian JIRA (v7.6.3#76005)