Mercurial > hg > blitz_condensed
comparison src/org/dancres/blitz/config/TimeBarrierPersistent.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.config; | |
2 | |
3 /** | |
4 <p>Configures Blitz to make operations durable after a certain period of | |
5 time such that if an operation was submitted more than that time period ago, | |
6 it is guarenteed to be durable.</p> | |
7 | |
8 <p>This kind of persistence provides the developer/administrator with the | |
9 ability to trade persistence guarentee for speed. Certain applications can | |
10 tolerate this sort of behaviour because they incorporate their own | |
11 consistency checks which allow them to recover a certain amount of recent | |
12 state that the space hadn't yet persisted.</p> | |
13 */ | |
14 public class TimeBarrierPersistent extends PersistentBase { | |
15 | |
16 private long theFlushTime; | |
17 | |
18 /** | |
19 @param shouldReset specifies whether to reset the ObjectOutputStream | |
20 used for logging. This is a performance vs memory tradeoff | |
21 | |
22 @param shouldClean specifies whether old log files and snapshots should | |
23 be cleaned up or left for archiving. | |
24 | |
25 @param aMaxLogsBeforeSync is the maximum number of log entries before | |
26 a checkpoint is forced. | |
27 | |
28 @param aLogBufferSize especially useful when doing flushing | |
29 All commands are rendered to the buffer before going to disk in one | |
30 large block. Without the buffer, each command will trickle to disk as a | |
31 small update which isn't good for throughput! | |
32 | |
33 @param aFlushTime the period in millis after which a logged command | |
34 should be made durable. | |
35 */ | |
36 public TimeBarrierPersistent(boolean shouldReset, boolean shouldClean, | |
37 int aMaxLogsBeforeSync, int aLogBufferSize, | |
38 long aFlushTime) { | |
39 | |
40 super(shouldReset, shouldClean, aLogBufferSize, aMaxLogsBeforeSync); | |
41 theFlushTime = aFlushTime; | |
42 } | |
43 | |
44 public long getFlushTime() { | |
45 return theFlushTime; | |
46 } | |
47 } |