From 054633ac7b957f0e2c27ee443b17e79d4ffbb38d Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Sat, 16 Dec 2006 21:18:49 +0000 Subject: Support write-no-sync mode for Sleepycat repositories. --- RELEASE-NOTES.txt | 1 + .../repo/sleepycat/BDBRepositoryBuilder.java | 25 ++++++++++++++++++---- 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, Integer> mDatabasePageSizes; private boolean mPrivate; @@ -422,21 +423,37 @@ 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 -- cgit v1.2.3