summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--RELEASE-NOTES.txt1
-rw-r--r--src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java25
2 files changed, 22 insertions, 4 deletions
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index 423b3ca..6e71fbc 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -7,6 +7,7 @@ Carbonado change history
table analyze to run.
- When a property evolves from a boxed primitive to an unboxed primitive, null
is converted to zero or false instead of throwing a NullPointerException.
+- Support write-no-sync mode for Sleepycat repositories.
1.1-BETA6 to 1.1-BETA7
-------------------------------
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.