diff src/org/dancres/blitz/txn/UnsyncdOps.java @ 0:3dc0c5604566

Initial checkin of blitz 2.0 fcs - no installer yet.
author Dan Creswell <dan.creswell@gmail.com>
date Sat, 21 Mar 2009 11:00:06 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/dancres/blitz/txn/UnsyncdOps.java	Sat Mar 21 11:00:06 2009 +0000
@@ -0,0 +1,31 @@
+package org.dancres.blitz.txn;
+
+import org.dancres.blitz.BootInfo;
+
+/**
+   <p>UnsyncdOps provides boot-time information concerning the maximum number
+   of log operations which might have occurred since the last full
+   checkpoint/sync was initiated.</p>
+
+   <p>We deliberately return double the op count to allow for interrupted 
+   checkpoints.  An interrupted checkpoint leads to two contiguous
+   log files with no separating checkpoint image.  The maximum number
+   of operations before the next checkpoint would, therefore be
+   double the maximum number of ops per checkpoint.  A checkpoint can
+   only be interrupted as the result of violent shutdown and, restart
+   will immediately resolve state using the UnsyncdOps.  If restart
+   fails to complete, there will be no further log entries or
+   checkpoints and the next restart will, worst case, apply the
+   state resolution twice which isn't harmful.</p>
+ */
+public class UnsyncdOps implements BootInfo, java.io.Serializable {
+    private int theOpCount;
+
+    UnsyncdOps(int anOpCount) {
+        theOpCount = 2 * anOpCount;
+    }
+
+    public int getOpsSinceLastCheckpoint() {
+        return theOpCount;
+    }
+}