diff options
author | Peter Carbon <peter_carbon@users.sourceforge.net> | 2008-12-18 00:37:37 +0000 |
---|---|---|
committer | Peter Carbon <peter_carbon@users.sourceforge.net> | 2008-12-18 00:37:37 +0000 |
commit | 073c648e12789aefa9d32b7ccf7d2c3a3b268936 (patch) | |
tree | 0f1ee75f51266cde91b0545a098821d745a76f04 /src/main/java/com/amazon/carbonado/repo | |
parent | f6394b632b619a91c12d60e0c3c1b4e18f61c653 (diff) |
Added cachePercent member variable to support maxMemoryPercent BDB configuration parameter.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java index f60511f..becb437 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java @@ -91,6 +91,7 @@ public class BDBRepositoryBuilder extends AbstractRepositoryBuilder { private double mIndexThrottle = 1.0;
private boolean mReadOnly;
private Long mCacheSize;
+ private Integer mCachePercent;
private double mLockTimeout = 0.5;
private double mTxnTimeout = 300.0;
private boolean mTxnNoSync;
@@ -437,6 +438,34 @@ public class BDBRepositoryBuilder extends AbstractRepositoryBuilder { }
/**
+ * Set the percent of JVM heap used by the repository cache. Actual
+ * BDB implementation will select a suitable default if this is not
+ * set. This is overridden by setting an explicit cacheSize.
+ */
+ public void setCachePercent(int cachePercent) {
+ mCachePercent = cachePercent;
+ }
+
+ /**
+ * Set the percent of JVM heap used by the repository cache. Actual
+ * BDB implementation will select a suitable default if this is not
+ * set. This is overridden by setting an explicit cacheSize.
+ *
+ * @param cachePercent percent of JVM heap to use, or null for default
+ */
+ public void setCachePercent(Integer cacheSize) {
+ mCachePercent = cacheSize;
+ }
+
+ /**
+ * Returns the percent of JVM heap used by the repository cache, or
+ * null if default should be selected.
+ */
+ public Integer getCachePercent() {
+ return mCachePercent;
+ }
+
+ /**
* Set the lock timeout, in seconds. Default value is 0.5 seconds.
*/
public void setLockTimeout(double lockTimeout) {
|