Author: frm
Date: Tue Nov 21 09:47:53 2017
New Revision: 1815894
URL: http://svn.apache.org/viewvc?rev=1815894&view=rev
Log:
OAK-6966 - Always use TarFiles#size in the estimation phase
The estimation phase should always use the same source for the repository size.
If the sources are different, and their semantics and accuracy differ, the
estimation phase might not be able to correctly compute. Since TarFiles#size is
used when writing the gc.log, it should also be used also when computing the
repository size at the beginning of the estimation phase.
Modified:
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java
Modified:
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java?rev=1815894&r1=1815893&r2=1815894&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java
(original)
+++
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java
Tue Nov 21 09:47:53 2017
@@ -694,7 +694,7 @@ public class FileStore extends AbstractF
* @return compaction gain estimate
*/
GCEstimationResult estimateCompactionGain(boolean full) {
- return new
SizeDeltaGcEstimation(gcOptions.getGcSizeDeltaEstimation(), gcJournal,
stats.getApproximateSize(), full).estimate();
+ return new
SizeDeltaGcEstimation(gcOptions.getGcSizeDeltaEstimation(), gcJournal,
tarFiles.size(), full).estimate();
}
@Nonnull