diff --git oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreService.java oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreService.java index e891165..2919488 100644 --- oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreService.java +++ oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreService.java @@ -25,7 +25,6 @@ import static org.apache.jackrabbit.oak.commons.PropertiesUtil.toInteger; import static org.apache.jackrabbit.oak.commons.PropertiesUtil.toLong; import static org.apache.jackrabbit.oak.osgi.OsgiUtil.lookupConfigurationThenFramework; import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.FORCE_TIMEOUT_DEFAULT; -import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.GAIN_THRESHOLD_DEFAULT; import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.PAUSE_DEFAULT; import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.RETAINED_GENERATIONS_DEFAULT; import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.RETRY_COUNT_DEFAULT; @@ -186,14 +185,6 @@ public class SegmentNodeStoreService extends ProxyNodeStore public static final String NODE_DEDUPLICATION_CACHE_SIZE = "nodeDeduplicationCache.size"; @Property( - byteValue = GAIN_THRESHOLD_DEFAULT, - label = "Compaction gain threshold", - description = "TarMK compaction gain threshold. The gain estimation prevents compaction from running " + - "if the provided threshold is not met. Value represents a percentage so an input between 0 and 100 is expected." - ) - public static final String COMPACTION_GAIN_THRESHOLD = "compaction.gainThreshold"; - - @Property( boolValue = PAUSE_DEFAULT, label = "Pause Compaction", description = "When enabled compaction would not be performed" @@ -617,7 +608,7 @@ public class SegmentNodeStoreService extends ProxyNodeStore int forceTimeout = toInteger(property(COMPACTION_FORCE_TIMEOUT), FORCE_TIMEOUT_DEFAULT); int retainedGenerations = toInteger(property(RETAINED_GENERATIONS), RETAINED_GENERATIONS_DEFAULT); - byte gainThreshold = getGainThreshold(); + byte gainThreshold = 0; long sizeDeltaEstimation = toLong(property(COMPACTION_SIZE_DELTA_ESTIMATION), SIZE_DELTA_ESTIMATION_DEFAULT); return new SegmentGCOptions(pauseCompaction, gainThreshold, retryCount, forceTimeout) @@ -715,16 +706,6 @@ public class SegmentNodeStoreService extends ProxyNodeStore return Integer.parseInt(getMaxFileSizeProperty()); } - private byte getGainThreshold() { - String gt = property(COMPACTION_GAIN_THRESHOLD); - - if (gt == null) { - return GAIN_THRESHOLD_DEFAULT; - } - - return Byte.valueOf(gt); - } - private String property(String name) { return lookupConfigurationThenFramework(context, name); } diff --git oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/CompactionGainEstimate.java oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/CompactionGainEstimate.java index 57286b8..3b18724 100644 --- oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/CompactionGainEstimate.java +++ oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/CompactionGainEstimate.java @@ -37,6 +37,7 @@ import org.apache.jackrabbit.oak.segment.SegmentNodeState; import org.apache.jackrabbit.oak.segment.SegmentPropertyState; import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry; +@Deprecated class CompactionGainEstimate implements TarEntryVisitor, GCEstimation { private static final Funnel UUID_FUNNEL = new Funnel() { diff --git oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java index 62f833f..d8023e5 100644 --- oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java +++ oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java @@ -777,6 +777,7 @@ public class FileStore extends AbstractFileStore { * @param stop signal for stopping the estimation process. * @return compaction gain estimate */ + @SuppressWarnings("deprecation") synchronized GCEstimation estimateCompactionGain(Supplier stop) { if (gcOptions.isGcSizeDeltaEstimation()) { SizeDeltaGcEstimation e = new SizeDeltaGcEstimation(gcOptions, @@ -784,6 +785,7 @@ public class FileStore extends AbstractFileStore { return e; } + gcListener.warn("TarMK GC #{}: Using deprecated CompactionGainEstimate to figure out compation gain!", GC_COUNT); CompactionGainEstimate estimate = new CompactionGainEstimate(getHead(), count(), stop, gcOptions.getGainThreshold()); fileStoreLock.readLock().lock();