Mercurial > hg > blitz_condensed
comparison src/org/dancres/blitz/config/Persistent.java @ 15:cd96fcac1487
Add support for nano-second batch windows.
author | Dan Creswell <dan.creswell@gmail.com> |
---|---|
date | Sun, 05 Jul 2009 16:23:58 +0100 |
parents | 3dc0c5604566 |
children | a77f0a9ed93c |
comparison
equal
deleted
inserted
replaced
14:872076165de4 | 15:cd96fcac1487 |
---|---|
7 @todo Add MAX_LOGS_BEFORE_SYNC disable | 7 @todo Add MAX_LOGS_BEFORE_SYNC disable |
8 */ | 8 */ |
9 public class Persistent extends PersistentBase { | 9 public class Persistent extends PersistentBase { |
10 | 10 |
11 private boolean useConcurrentBatcher; | 11 private boolean useConcurrentBatcher; |
12 private int theBatchWriteWindowSize; | 12 private long theBatchWriteWindowSizeMs; |
13 private int theBatchWriteWindowSizeNs; | |
13 | 14 |
14 /** | 15 /** |
15 @param shouldReset specifies whether to reset the ObjectOutputStream | 16 @param shouldReset specifies whether to reset the ObjectOutputStream |
16 used for logging. This is a performance vs memory tradeoff | 17 used for logging. This is a performance vs memory tradeoff |
17 | 18 |
42 int aBatchWriteWindowSize, boolean useConcurrent, | 43 int aBatchWriteWindowSize, boolean useConcurrent, |
43 int aMaxLogsBeforeSync, int aLogBufferSize) { | 44 int aMaxLogsBeforeSync, int aLogBufferSize) { |
44 | 45 |
45 super(shouldReset, shouldClean, aLogBufferSize, aMaxLogsBeforeSync); | 46 super(shouldReset, shouldClean, aLogBufferSize, aMaxLogsBeforeSync); |
46 useConcurrentBatcher = useConcurrent; | 47 useConcurrentBatcher = useConcurrent; |
47 theBatchWriteWindowSize = aBatchWriteWindowSize; | 48 theBatchWriteWindowSizeMs = aBatchWriteWindowSize; |
48 } | 49 } |
49 | 50 |
50 public boolean useConcurrentWriteBatcher() { | 51 public boolean useConcurrentWriteBatcher() { |
51 return useConcurrentBatcher; | 52 return useConcurrentBatcher; |
52 } | 53 } |
53 | 54 |
54 public int getBatchWriteWindowSize() { | 55 public long getBatchWriteWindowSizeMs() { |
55 return theBatchWriteWindowSize; | 56 return theBatchWriteWindowSizeMs; |
57 } | |
58 | |
59 public int getBatchWriteWindowSizeNs() { | |
60 return theBatchWriteWindowSizeNs; | |
61 } | |
62 | |
63 public Persistent(boolean shouldReset, boolean shouldClean, | |
64 long aBatchWindowSizeMs, int aBatchWindowSizeNs, boolean useConcurrent, | |
65 int aMaxLogsBeforeSync, int aLogBufferSize) { | |
66 | |
67 super(shouldReset, shouldClean, aLogBufferSize, aMaxLogsBeforeSync); | |
68 useConcurrentBatcher = useConcurrent; | |
69 theBatchWriteWindowSizeMs = aBatchWindowSizeMs; | |
70 theBatchWriteWindowSizeNs = aBatchWindowSizeNs; | |
56 } | 71 } |
57 } | 72 } |