From d0684a34f12a3533343e7b1a2a81cbad3c6c7221 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Tue, 17 Mar 2009 20:12:00 +0000 Subject: Added backup restore functionality. --- .../carbonado/repo/sleepycat/BDBRepositoryBuilder.java | 17 +++++++++++++++++ .../carbonado/repo/sleepycat/HotBackupCapability.java | 7 +++++-- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/repo') 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; @@ -625,6 +626,22 @@ public class BDBRepositoryBuilder extends AbstractRepositoryBuilder { return mLogInMemory; } + /** + * 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 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 critical 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; -- cgit v1.2.3