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