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

Jukka Zitting commented on OAK-763:
-----------------------------------

Here's a draft of how I see these kinds of background processing task to work:

{code}
class BackgroundTask implements Runnable {
    private static final Logger log = ...;
    private final NodeStore store = ...;
    private final CommitHook hook = ...;
    private NodeState before = store.getRoot();
    @Override
    public void run() {
        NodeStoreBranch branch = store.branch();
        NodeState after = branch.getHead();
        try {
            NodeState processed =
                    hook.processCommit(before, after);
            branch.setRoot(processed);
            branch.merge(EmptyHook.INSTANCE);
            before = after;
        } catch (CommitFailedException e) {
            log.warning("Backgournd update failed", e);
        }
    }
}
{code}
                
> Asynchronous indexing
> ---------------------
>
>                 Key: OAK-763
>                 URL: https://issues.apache.org/jira/browse/OAK-763
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: core
>            Reporter: Alex Parvulescu
>            Assignee: Alex Parvulescu
>         Attachments: OAK-763-mv-scheduler.patch, OAK-763.patch
>
>
> It would be good to have the possibility to update indexes asynchronously, 
> outside the current commit hook (or editor).
> This would be used for the index impls which can be a bit behind, like the 
> ones that do text extraction from binaries.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to