[ 
https://issues.apache.org/jira/browse/OAK-2589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chetan Mehrotra updated OAK-2589:
---------------------------------
    Attachment: OAK-2589.patch

[patch|^OAK-2589.patch] which wraps the {{IndexUpdateCallback}} with an index 
editor specific {{CountingCallback}} to maintain {{indexUpdate}} invocation 
count per editor instance.

During indexing it would also log progress for every 1000 invocation of 
{{indexUpdate}}  for that specific editor

{noformat}
2015-03-08 14:30:15,400 INFO  NA [pool-10-thread-2] o.a.j.o.p.index.IndexUpdate 
- /oak:index/lucene => Indexed 70000 nodes... 
2015-03-08 14:30:15,508 INFO  NA [pool-10-thread-2] o.a.j.o.p.index.IndexUpdate 
- /oak:index/lucene => Indexed 71000 nodes... 
2015-03-08 14:30:15,613 INFO  NA [pool-10-thread-2] o.a.j.o.p.index.IndexUpdate 
- /oak:index/lucene => Indexed 72000 nodes... 
2015-03-08 14:30:15,687 INFO  NA [pool-10-thread-2] o.a.j.o.p.index.IndexUpdate 
- /oak:index/lucene => Indexed 73000 nodes... 
2015-03-08 14:30:15,788 INFO  NA [pool-10-thread-2] o.a.j.o.p.index.IndexUpdate 
- /oak:index/lucene => Indexed 74000 nodes... 
2015-03-08 14:30:15,870 INFO  NA [pool-10-thread-2] o.a.j.o.p.index.IndexUpdate 
- /oak:index/lucene => Indexed 75000 nodes... 
2015-03-08 14:30:15,954 INFO  NA [pool-10-thread-2] o.a.j.o.p.index.IndexUpdate 
- /oak:index/lucene => Indexed 76000 nodes... 
{noformat}

This would log at info level the index stats when it detects that reindexing is 
performed for one of the editor. The stats would report the number of nodes 
which were indexed for that index definition

{noformat}
2015-03-08 14:30:23,571 INFO  NA [pool-10-thread-2] o.a.j.o.p.index.IndexUpdate 
- Indexing report
        - /oak:index/analytics*(0)
        - /oak:index/counter*(108)
        - /oak:index/cq*(0)
        - /oak:index/authorizables*(13)
        - /oak:index/lucene*(87977)
        - /oak:index/tags*(0)
2015-03-08 14:30:23,603 INFO  NA [pool-10-thread-2] 
o.a.j.o.p.i.AsyncIndexUpdate - Reindexing completed for indexes: 
[/oak:index/analytics*(0), /oak:index/counter*(108), /oak:index/cq*(0), 
/oak:index/authorizables*(13), /oak:index/lucene*(87977), /oak:index/tags*(0)] 
in 23.11 s 
{noformat}

[~alex.parvulescu] Again can you have a look :). Specific aspects to think about

# Would it be fine to report for every 1000
# Add javadoc to indexUpdate in {{IndexUpdateCallback}} to call out that this 
should be invoked mostly when an entry is made to the index. There is no hard 
rule for that and editor can make extra calls but it would be preferable if 
calls are made _mostly_ for entries added to index

Later we can expose those stats via JMX also


> Provide progress indication when reindexing is being peformed
> -------------------------------------------------------------
>
>                 Key: OAK-2589
>                 URL: https://issues.apache.org/jira/browse/OAK-2589
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>             Fix For: 1.1.8, 1.0.13
>
>         Attachments: OAK-2589.patch
>
>
> When reindex property of an oak:QueryIndexDefinition node is set to "true" 
> there is a message logged which says:
> 29.09.2014 15:04:08.904 *INFO* [pool-9-thread-3] 
> org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing would be 
> performed for following indexes [/oak:index/searchFacets]
> However, after that, there is no indication of progress for this reindexing. 
> The only way to determine if the reindexing is progressing is to check back 
> and see that the reindex property on your oak:QueryIndexDefinition node is 
> now set to false.
> If something goes wrong with the reindexing it is hard to know if the 
> reindexing is happening at all. 
> If there could be some logging to indicate that this reindexing is happening 
> successfully and how complete it is, it would be of a great help while 
> troubleshooting indexing problems.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to