You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Jason E Bailey (Jira)" <ji...@apache.org> on 2020/01/31 13:47:00 UTC

[jira] [Commented] (SLING-9044) Use traversal to count items in resource based distribution queue

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

Jason E Bailey commented on SLING-9044:
---------------------------------------

As a note, we have a traversal library that's part of the core Sling bundles https://github.com/apache/sling-org-apache-sling-resource-filter 

> Use traversal to count items in resource based distribution queue
> -----------------------------------------------------------------
>
>                 Key: SLING-9044
>                 URL: https://issues.apache.org/jira/browse/SLING-9044
>             Project: Sling
>          Issue Type: Bug
>          Components: Content Distribution
>            Reporter: Mohit Arora
>            Assignee: Timothee Maret
>            Priority: Major
>             Fix For: Content Distribution Core 0.4.2
>
>
> [ResourceQueueUtils# getResourceCount()|https://github.com/apache/sling-org-apache-sling-distribution-core/blob/master/src/main/java/org/apache/sling/distribution/queue/impl/resource/ResourceQueueUtils.java#L320] function is responsible for triggering an xpath query to get the resource queue items. This query tries to find all the {{nt:unstructured}} nodes under a resource queue's path. This query is currently not backed by any index definition. This leads to a warning like below being logged when a request is made to list the items of resource queue - 
> {code}11.12.2019 14:15:46.926 *WARN* [0:0:0:0:0:0:0:1 [1576053946802] GET /libs/granite/distribution/content/distribution-agent.html HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl Traversal query (query without index): select [jcr:path], [jcr:score], * from [nt:unstructured] as a where isdescendantnode(a, '/var/sling/distribution/queues/bpqatest0/error-endpoint-bpqatest0') /* xpath: /jcr:root/var/sling/distribution/queues/bpqatest0/error-endpoint-bpqatest0//element(*,nt:unstructured) */; consider creating an index
> {code}
> Switching to traversal here would be as efficient as writing an index for this query. 
> Further, since a resource queue can also be an {{active}} queue and the items will come and go, the indexer will have to do extra work of indexing the transient items.
> cc - [~marett], [~ashishc]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)