diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2009-03-17 20:12:00 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2009-03-17 20:12:00 +0000 |
commit | d0684a34f12a3533343e7b1a2a81cbad3c6c7221 (patch) | |
tree | 416045bacede0fbbfc3fff1bbb66d84233e14932 /src | |
parent | 2f4a6a755cd34e929faf55daacb8f69fdde6be43 (diff) |
Added backup restore functionality.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java | 17 | ||||
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/sleepycat/HotBackupCapability.java | 7 |
2 files changed, 22 insertions, 2 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 1497417..9301f28 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java @@ -101,6 +101,7 @@ public class BDBRepositoryBuilder extends AbstractRepositoryBuilder { private boolean mPrivate;
private boolean mMultiversion;
private boolean mLogInMemory;
+ private boolean mRunFullRecovery;
private boolean mRunCheckpointer = true;
private int mCheckpointInterval = DEFAULT_CHECKPOINT_INTERVAL;
private boolean mRunDeadlockDetector = true;
@@ -626,6 +627,22 @@ public class BDBRepositoryBuilder extends AbstractRepositoryBuilder { }
/**
+ * Pass true to override the default and run a full (catastrophic) recovery
+ * when environment is opened. This setting has no effect for BDB-JE.
+ */
+ public void setRunFullRecovery(boolean runRecovery) {
+ mRunFullRecovery = runRecovery;
+ }
+
+ /**
+ * Returns true if a full (catastrophic) recovery should be performed when
+ * environment is opened.
+ */
+ public boolean getRunFullRecovery() {
+ return mRunFullRecovery;
+ }
+
+ /**
* Disable automatic checkpointing of database if another process is
* responsible for that. The false setting is implied for read-only
* databases.
diff --git a/src/main/java/com/amazon/carbonado/repo/sleepycat/HotBackupCapability.java b/src/main/java/com/amazon/carbonado/repo/sleepycat/HotBackupCapability.java index 8bce86d..c65d2c8 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/HotBackupCapability.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/HotBackupCapability.java @@ -25,7 +25,10 @@ import com.amazon.carbonado.RepositoryException; import com.amazon.carbonado.capability.Capability;
/**
- * Capability for performing a backup of an active BDB environment.
+ * Capability for performing a backup of an active BDB environment. To restore
+ * from a hot backup, it is <b>critical</b> that a full recovery be
+ * performed. BDB-JE does not require this, however. Pass true to {@link
+ * BDBRepositoryBuilder#setRunFullRecovery(boolean)} to enable.
*
* @author Brian S O'Neill
* @since 1.2.1
@@ -33,7 +36,7 @@ import com.amazon.carbonado.capability.Capability; public interface HotBackupCapability extends Capability {
/**
* Starts the backup by disabling log file deletion. Be sure to call
- * endBackup when done to resume log file cleanup. Concurrent backups is
+ * endBackup when done to resume log file cleanup. Concurrent backups are
* supported.
*/
Backup startBackup() throws RepositoryException;
|