summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2006-12-16 21:18:49 +0000
committerBrian S. O'Neill <bronee@gmail.com>2006-12-16 21:18:49 +0000
commit054633ac7b957f0e2c27ee443b17e79d4ffbb38d (patch)
treeec16027384f3b77b0ce4aca07e71fc38e5d764d0 /src
parentdef1ccb9ef71ae1aadd62f8f4cb05ac614aee9c1 (diff)
Support write-no-sync mode for Sleepycat repositories.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java25
1 files changed, 21 insertions, 4 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 28123a3..86636c4 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 mLockTimeout = 0.5;
private double mTxnTimeout = 300.0;
private boolean mTxnNoSync;
+ private boolean mTxnWriteNoSync;
private Boolean mDatabasesTransactional = null;
private Map<Class<?>, Integer> mDatabasePageSizes;
private boolean mPrivate;
@@ -422,22 +423,38 @@ public class BDBRepositoryBuilder extends AbstractRepositoryBuilder {
}
/**
- * When true, commits are not forcibly flushed to disk. This improves
- * performance, but there is a chance of losing the most recent commits if
- * the machine crashes.
+ * When true, commits are not immediately written or flushed to disk. This
+ * improves performance, but there is a chance of losing the most recent
+ * commits if the process is killed or if the machine crashes.
*/
public void setTransactionNoSync(boolean noSync) {
mTxnNoSync = noSync;
}
/**
- * Returns true if transactions are forcibly flushed to disk.
+ * Returns true if transactions are not written or flushed to disk.
*/
public boolean getTransactionNoSync() {
return mTxnNoSync;
}
/**
+ * When true, commits are written, but they are not flushed to disk. This
+ * improves performance, but there is a chance of losing the most recent
+ * commits if the machine crashes.
+ */
+ public void setTransactionWriteNoSync(boolean noSync) {
+ mTxnWriteNoSync = noSync;
+ }
+
+ /**
+ * Returns true if transactions are not flushed to disk.
+ */
+ public boolean getTransactionWriteNoSync() {
+ return mTxnWriteNoSync;
+ }
+
+ /**
* When true, allows databases to be transactional. This setting affects
* the databases, not the environment. If this is not explicitly set, the
* environment getTransactional is used.