diff src/org/dancres/blitz/config/Persistent.java @ 32:a77f0a9ed93c 2.1.1

Add support for optimistic log batching.
author Dan Creswell <dan.creswell@gmail.com>
date Sat, 12 Jun 2010 10:42:31 +0100
parents cd96fcac1487
children
line wrap: on
line diff
--- a/src/org/dancres/blitz/config/Persistent.java	Sat Jun 12 10:41:47 2010 +0100
+++ b/src/org/dancres/blitz/config/Persistent.java	Sat Jun 12 10:42:31 2010 +0100
@@ -8,7 +8,7 @@
  */
 public class Persistent extends PersistentBase {
 
-    private boolean useConcurrentBatcher;
+    private boolean dontUseExpLog;
     private long theBatchWriteWindowSizeMs;
     private int theBatchWriteWindowSizeNs;
 
@@ -28,8 +28,8 @@
        entering the barrier are now blocked until the first entrant commits all
        writes to log.
 
-       @param useConcurrent should increase log throughput by allowing the
-       next batch to form whilst the current batch is being written to log.
+       @param noUseExpLog avoid using optimistic logger which should increase log throughput
+       by allowing an optimistic flushing strategy but may still contain bugs
 
        @param aMaxLogsBeforeSync is the maximum number of log entries before
        a checkpoint is forced.
@@ -40,16 +40,16 @@
        small update which isn't good for throughput!
      */
     public Persistent(boolean shouldReset, boolean shouldClean,
-                      int aBatchWriteWindowSize, boolean useConcurrent,
+                      int aBatchWriteWindowSize, boolean noUseExpLog,
                       int aMaxLogsBeforeSync, int aLogBufferSize) {
 
         super(shouldReset, shouldClean, aLogBufferSize, aMaxLogsBeforeSync);
-        useConcurrentBatcher = useConcurrent;
+        dontUseExpLog = noUseExpLog;
         theBatchWriteWindowSizeMs = aBatchWriteWindowSize;
     }
 
-    public boolean useConcurrentWriteBatcher() {
-        return useConcurrentBatcher;
+    public boolean dontUseExperimentalBatcher() {
+        return dontUseExpLog;
     }
 
     public long getBatchWriteWindowSizeMs() {
@@ -61,11 +61,11 @@
     }
 
     public Persistent(boolean shouldReset, boolean shouldClean,
-                      long aBatchWindowSizeMs, int aBatchWindowSizeNs, boolean useConcurrent,
+                      long aBatchWindowSizeMs, int aBatchWindowSizeNs, boolean noUseExpLog,
                       int aMaxLogsBeforeSync, int aLogBufferSize) {
 
         super(shouldReset, shouldClean, aLogBufferSize, aMaxLogsBeforeSync);
-        useConcurrentBatcher = useConcurrent;
+        dontUseExpLog = noUseExpLog;
         theBatchWriteWindowSizeMs = aBatchWindowSizeMs;
         theBatchWriteWindowSizeNs = aBatchWindowSizeNs;
     }