You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Michael Dürig (JIRA)" <ji...@apache.org> on 2016/05/11 14:43:12 UTC

[jira] [Resolved] (OAK-4280) Compaction cannot be cancelled

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

Michael Dürig resolved OAK-4280.
--------------------------------
    Resolution: Fixed

Fixed at http://svn.apache.org/viewvc?rev=1743381&view=rev

The fix introduces a new method on {{SegmentWriter}}:

{code}
/**
 * Write a node state, unless cancelled
 * @param state   node state to write
 * @param cancel  supplier to signal cancellation of this write operation
 * @return segment node state equal to {@code state} or {@code null} if cancelled.
 * @throws IOException
 */
@CheckForNull
public SegmentNodeState writeNode(final NodeState state, Supplier<Boolean> cancel)
{code}

This method is used for online compaction. Cancellation can be triggered through the passed supplier. 

Internally the implementation uses an (encapsulated) exception to break out of the recursive call chain. While this doesn't win any beauty contest, I figured it to be the most effective way to separate normal code flow from the special case of cancellation. 

> Compaction cannot be cancelled 
> -------------------------------
>
>                 Key: OAK-4280
>                 URL: https://issues.apache.org/jira/browse/OAK-4280
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: segment-tar
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>              Labels: compaction, gc
>             Fix For: 1.6
>
>
> As a result of the de-duplication cache based online compaction approach from OAK-3348 compaction cannot be cancelled any more (in the sense of OAK-3290). 
> As I assume we still need this feature we should look into ways to re-implement it on top of the current approach. 
> Also I figure implementing a [partial compaction | https://issues.apache.org/jira/browse/OAK-4122?focusedCommentId=15223924&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15223924] approach on top of a commit scheduler (OAK-4122) would need a feature of this sort. 



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