Mercurial > hg > blitz_condensed
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3dc0c5604566 |
---|---|
1 package org.dancres.blitz.txn; | |
2 | |
3 import org.dancres.blitz.BootInfo; | |
4 | |
5 /** | |
6 <p>UnsyncdOps provides boot-time information concerning the maximum number | |
7 of log operations which might have occurred since the last full | |
8 checkpoint/sync was initiated.</p> | |
9 | |
10 <p>We deliberately return double the op count to allow for interrupted | |
11 checkpoints. An interrupted checkpoint leads to two contiguous | |
12 log files with no separating checkpoint image. The maximum number | |
13 of operations before the next checkpoint would, therefore be | |
14 double the maximum number of ops per checkpoint. A checkpoint can | |
15 only be interrupted as the result of violent shutdown and, restart | |
16 will immediately resolve state using the UnsyncdOps. If restart | |
17 fails to complete, there will be no further log entries or | |
18 checkpoints and the next restart will, worst case, apply the | |
19 state resolution twice which isn't harmful.</p> | |
20 */ | |
21 public class UnsyncdOps implements BootInfo, java.io.Serializable { | |
22 private int theOpCount; | |
23 | |
24 UnsyncdOps(int anOpCount) { | |
25 theOpCount = 2 * anOpCount; | |
26 } | |
27 | |
28 public int getOpsSinceLastCheckpoint() { | |
29 return theOpCount; | |
30 } | |
31 } |