summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/amazon')
-rw-r--r--src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java29
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) {