[
https://issues.apache.org/jira/browse/OAK-4105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15382354#comment-15382354
]
Michael Dürig commented on OAK-4105:
------------------------------------
Thanks for sending a patch. There is one thing I don't understand though:
{code}
@@ -793,7 +797,6 @@ public class FileStore implements SegmentStore, Closeable {
}
long finalSize = size();
- approximateSize.set(finalSize);
stats.reclaimed(initialSize - finalSize);
// FIXME OAK-4106: Reclaimed size reported by FileStore.cleanup is off
gcListener.cleaned(initialSize - finalSize, finalSize);
@@ -1389,7 +1392,7 @@ public class FileStore implements SegmentStore, Closeable
{
{code}
(Why) is it safe to remove this line?
Also I think we could get rid of {{FileStore.initialSize()}} and inline it into
the for loop over the readers directly before where that method is invoked
from.
> Implement FileStore.size through FileStore.approximateSize
> ----------------------------------------------------------
>
> Key: OAK-4105
> URL: https://issues.apache.org/jira/browse/OAK-4105
> Project: Jackrabbit Oak
> Issue Type: Technical task
> Components: segment-tar
> Reporter: Michael Dürig
> Assignee: Andrei Dulceanu
> Priority: Minor
> Labels: resilience
> Fix For: Segment Tar 0.0.6
>
> Attachments: OAK-4105-01.patch
>
>
> {{FileStore.size()}} is prone to lock contention and should not be called too
> often. As OAK-2879 already introduced an approach for tracking the current
> size of the file store without having to lock, we might as well promote his
> to be "the official" implementation.
> [~frm] WDYT?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)