You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by md...@apache.org on 2016/09/13 08:18:13 UTC
svn commit: r1760491 - in
/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment:
SegmentNodeStoreService.java compaction/SegmentGCOptions.java
compaction/SegmentRevisionGC.java compaction/SegmentRevisionGCMBean.java
Author: mduerig
Date: Tue Sep 13 08:18:13 2016
New Revision: 1760491
URL: http://svn.apache.org/viewvc?rev=1760491&view=rev
Log:
OAK-4281: Rework memory estimation for compaction
Remove dangling configuration options
Modified:
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreService.java
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentGCOptions.java
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGC.java
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGCMBean.java
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreService.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreService.java?rev=1760491&r1=1760490&r2=1760491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreService.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreService.java Tue Sep 13 08:18:13 2016
@@ -26,7 +26,6 @@ import static org.apache.jackrabbit.oak.
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.MEMORY_THRESHOLD_DEFAULT;
import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.PAUSE_DEFAULT;
import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.RETRY_COUNT_DEFAULT;
import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.SIZE_DELTA_ESTIMATION_DEFAULT;
@@ -183,13 +182,6 @@ public class SegmentNodeStoreService ext
public static final String NODE_DEDUPLICATION_CACHE_SIZE = "nodeDeduplicationCache.size";
@Property(
- byteValue = MEMORY_THRESHOLD_DEFAULT,
- label = "Memory Multiplier",
- description = "TarMK compaction available memory multiplier needed to run compaction"
- )
- public static final String COMPACTION_MEMORY_THRESHOLD = "compaction.memoryThreshold";
-
- @Property(
byteValue = GAIN_THRESHOLD_DEFAULT,
label = "Compaction gain threshold",
description = "TarMK compaction gain threshold. The gain estimation prevents compaction from running " +
@@ -527,12 +519,10 @@ public class SegmentNodeStoreService ext
int retryCount = toInteger(property(COMPACTION_RETRY_COUNT), RETRY_COUNT_DEFAULT);
int forceTimeout = toInteger(property(COMPACTION_FORCE_TIMEOUT), FORCE_TIMEOUT_DEFAULT);
- byte memoryThreshold = getMemoryThreshold();
byte gainThreshold = getGainThreshold();
long sizeDeltaEstimation = toLong(COMPACTION_SIZE_DELTA_ESTIMATION, SIZE_DELTA_ESTIMATION_DEFAULT);
- return new SegmentGCOptions(
- pauseCompaction, memoryThreshold, gainThreshold, retryCount, forceTimeout)
+ return new SegmentGCOptions(pauseCompaction, gainThreshold, retryCount, forceTimeout)
.setGcSizeDeltaEstimation(sizeDeltaEstimation);
}
@@ -712,16 +702,6 @@ public class SegmentNodeStoreService ext
return Integer.parseInt(getMaxFileSizeProperty());
}
- private byte getMemoryThreshold() {
- String mt = property(COMPACTION_MEMORY_THRESHOLD);
-
- if (mt == null) {
- return MEMORY_THRESHOLD_DEFAULT;
- }
-
- return Byte.valueOf(mt);
- }
-
private byte getGainThreshold() {
String gt = property(COMPACTION_GAIN_THRESHOLD);
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentGCOptions.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentGCOptions.java?rev=1760491&r1=1760490&r2=1760491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentGCOptions.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentGCOptions.java Tue Sep 13 08:18:13 2016
@@ -32,11 +32,6 @@ public class SegmentGCOptions {
public static final boolean PAUSE_DEFAULT = false;
/**
- * Default value for {@link #getMemoryThreshold()}
- */
- public static final byte MEMORY_THRESHOLD_DEFAULT = 5;
-
- /**
* Default value for {@link #getGainThreshold()}
*/
public static final byte GAIN_THRESHOLD_DEFAULT = 10;
@@ -63,8 +58,6 @@ public class SegmentGCOptions {
private boolean paused = PAUSE_DEFAULT;
- private int memoryThreshold = MEMORY_THRESHOLD_DEFAULT;
-
private int gainThreshold = GAIN_THRESHOLD_DEFAULT;
private int retryCount = RETRY_COUNT_DEFAULT;
@@ -86,23 +79,20 @@ public class SegmentGCOptions {
"oak.segment.compaction.gcSizeDeltaEstimation",
SIZE_DELTA_ESTIMATION_DEFAULT);
- public SegmentGCOptions(boolean paused, int memoryThreshold, int gainThreshold,
- int retryCount, int forceTimeout) {
+ public SegmentGCOptions(boolean paused, int gainThreshold, int retryCount, int forceTimeout) {
this.paused = paused;
- this.memoryThreshold = memoryThreshold;
this.gainThreshold = gainThreshold;
this.retryCount = retryCount;
this.forceTimeout = forceTimeout;
}
public SegmentGCOptions() {
- this(PAUSE_DEFAULT, MEMORY_THRESHOLD_DEFAULT, GAIN_THRESHOLD_DEFAULT,
- RETRY_COUNT_DEFAULT, FORCE_TIMEOUT_DEFAULT);
+ this(PAUSE_DEFAULT, GAIN_THRESHOLD_DEFAULT, RETRY_COUNT_DEFAULT, FORCE_TIMEOUT_DEFAULT);
}
/**
- * Default options: {@link #PAUSE_DEFAULT}, {@link #MEMORY_THRESHOLD_DEFAULT},
- * {@link #GAIN_THRESHOLD_DEFAULT}, {@link #RETRY_COUNT_DEFAULT}, {@link #FORCE_TIMEOUT_DEFAULT}.
+ * Default options: {@link #PAUSE_DEFAULT}, {@link #GAIN_THRESHOLD_DEFAULT},
+ * {@link #RETRY_COUNT_DEFAULT}, {@link #FORCE_TIMEOUT_DEFAULT}.
*/
public static SegmentGCOptions defaultGCOptions() {
return new SegmentGCOptions();
@@ -126,23 +116,6 @@ public class SegmentGCOptions {
}
/**
- * @return the memory threshold below which revision gc will not run.
- */
- public int getMemoryThreshold() {
- return memoryThreshold;
- }
-
- /**
- * Set the memory threshold below which revision gc will not run.
- * @param memoryThreshold
- * @return this instance
- */
- public SegmentGCOptions setMemoryThreshold(int memoryThreshold) {
- this.memoryThreshold = memoryThreshold;
- return this;
- }
-
- /**
* Get the gain estimate threshold beyond which revision gc should run
* @return gainThreshold
*/
@@ -240,7 +213,6 @@ public class SegmentGCOptions {
} else {
return getClass().getSimpleName() + "{" +
"paused=" + paused +
- ", memoryThreshold=" + memoryThreshold +
", gainThreshold=" + gainThreshold +
", retryCount=" + retryCount +
", forceTimeout=" + forceTimeout +
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGC.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGC.java?rev=1760491&r1=1760490&r2=1760491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGC.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGC.java Tue Sep 13 08:18:13 2016
@@ -49,17 +49,6 @@ public interface SegmentRevisionGC {
void setGainThreshold(int gainThreshold);
/**
- * @return the memory threshold below which revision gc will not run.
- */
- int getMemoryThreshold();
-
- /**
- * Set the memory threshold below which revision gc will not run.
- * @param memoryThreshold
- */
- void setMemoryThreshold(int memoryThreshold);
-
- /**
* Get the number of tries to compact concurrent commits on top of already
* compacted commits
* @return retry count
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGCMBean.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGCMBean.java?rev=1760491&r1=1760490&r2=1760491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGCMBean.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGCMBean.java Tue Sep 13 08:18:13 2016
@@ -54,16 +54,6 @@ public class SegmentRevisionGCMBean
}
@Override
- public int getMemoryThreshold() {
- return gcOptions.getMemoryThreshold();
- }
-
- @Override
- public void setMemoryThreshold(int memoryThreshold) {
- gcOptions.setMemoryThreshold(memoryThreshold);
- }
-
- @Override
public int getRetryCount() {
return gcOptions.getRetryCount();
}