diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java | 13 | ||||
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/sleepycat/CheckpointCapability.java | 10 |
2 files changed, 21 insertions, 2 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 baaddf3..b423ab9 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java @@ -331,6 +331,14 @@ abstract class BDBRepository<Txn> extends AbstractRepository<Txn> }
}
+ public void sync() throws PersistException {
+ try {
+ env_sync();
+ } catch (Exception e) {
+ throw toPersistException(e);
+ }
+ }
+
public Repository getRootRepository() {
return mRootRef.get();
}
@@ -653,6 +661,11 @@ abstract class BDBRepository<Txn> extends AbstractRepository<Txn> abstract void env_checkpoint() throws Exception;
/**
+ * Synchronously flush changes to stable storage.
+ */
+ abstract void env_sync() throws Exception;
+
+ /**
* @param kBytes run checkpoint if at least this many kilobytes in log
* @param minutes run checkpoint if at least this many minutes passed since
* last checkpoint
diff --git a/src/main/java/com/amazon/carbonado/repo/sleepycat/CheckpointCapability.java b/src/main/java/com/amazon/carbonado/repo/sleepycat/CheckpointCapability.java index 354655e..f27d6e3 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/CheckpointCapability.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/CheckpointCapability.java @@ -54,8 +54,14 @@ public interface CheckpointCapability extends Capability { * disabled. If a checkpoint is in progress, then this method will block
* until it is finished, and then run another checkpoint. This method does
* not return until the requested checkpoint has finished.
- *
- * @throws PersistDeniedException if disabled during a hot backup
*/
void forceCheckpoint() throws PersistException;
+
+ /**
+ * Synchronously flushes changes to stable storage, which is cheaper than
+ * performing a checkpoint.
+ *
+ * @since 1.2.2
+ */
+ void sync() throws PersistException;
}
|