diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2010-01-07 00:10:17 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2010-01-07 00:10:17 +0000 |
commit | ae9863bf787a34a276b4118239ea1946e1abc679 (patch) | |
tree | ba76b49728ce9b96b16feb0e26aefc9f532869c2 /src/main/java | |
parent | 3429d9986c678c2c89d3d98795d405d5058b1512 (diff) |
Add option to keep old transaction log files.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java | 2 | ||||
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java | 19 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java index 28fc347..dabb4fb 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java @@ -112,6 +112,7 @@ abstract class BDBRepository<Txn> extends AbstractRepository<Txn> private final Map<Class<?>, Integer> mDatabasePageSizes;
final boolean mRunCheckpointer;
+ final boolean mKeepOldLogFiles;
final boolean mRunDeadlockDetector;
final File mDataHome;
@@ -155,6 +156,7 @@ abstract class BDBRepository<Txn> extends AbstractRepository<Txn> mTxnMgr = new BDBTransactionManager<Txn>(mExTransformer, this);
mRunCheckpointer = !builder.getReadOnly() && builder.getRunCheckpointer();
+ mKeepOldLogFiles = builder.getKeepOldLogFiles();
mRunDeadlockDetector = builder.getRunDeadlockDetector();
mStorableCodecFactory = builder.getStorableCodecFactory();
mPreShutdownHook = builder.getPreShutdownHook();
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 0beea65..f3c80ae 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java @@ -108,6 +108,7 @@ public class BDBRepositoryBuilder extends AbstractRepositoryBuilder { private int mCheckpointInterval = DEFAULT_CHECKPOINT_INTERVAL;
private int mCheckpointThresholdKB = 1024;
private int mCheckpointThresholdMinutes = 5;
+ private boolean mKeepOldLogFiles;
private boolean mRunDeadlockDetector = true;
private Boolean mChecksumEnabled;
private Object mInitialEnvConfig = null;
@@ -742,6 +743,24 @@ public class BDBRepositoryBuilder extends AbstractRepositoryBuilder { }
/**
+ * By default, transaction log files are deleted when no longer needed.
+ * Keeping log files can be used for incremental backups or for diagnosing
+ * problems. If using BDB-JE, old log files are renamed with a ".del"
+ * extension. If using BDB-core, the db_archive utility is required for
+ * identifying old log files.
+ */
+ public void setKeepOldLogFiles(boolean keep) {
+ mKeepOldLogFiles = keep;
+ }
+
+ /**
+ * Returns false by default.
+ */
+ public boolean getKeepOldLogFiles() {
+ return mKeepOldLogFiles;
+ }
+
+ /**
* Disable automatic deadlock detection of database if another thread is
* responsible for that.
*/
|