activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r698335 - /activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/util/DiskBenchmark.java
Date Tue, 23 Sep 2008 20:16:37 GMT
Author: chirino
Date: Tue Sep 23 13:16:36 2008
New Revision: 698335

URL: http://svn.apache.org/viewvc?rev=698335&view=rev
Log:
Some OSes have BIG write buffers.. sync to make sure the writes are getting done.

Modified:
    activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/util/DiskBenchmark.java

Modified: activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/util/DiskBenchmark.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/util/DiskBenchmark.java?rev=698335&r1=698334&r2=698335&view=diff
==============================================================================
--- activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/util/DiskBenchmark.java (original)
+++ activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/util/DiskBenchmark.java Tue Sep
23 13:16:36 2008
@@ -234,8 +234,13 @@
                     break;
                 }
             }
+            // Sync to disk so that the we actually write the data to disk.. otherwise 
+            // OS buffering might not really do the write.
+            raf.getFD().sync();
         }
+        raf.getFD().sync();
         raf.close();
+        now = System.currentTimeMillis();
         
         rc.size = data.length;
         rc.writes = ioCount;
@@ -261,6 +266,7 @@
             }
         }
         raf.close();
+        now = System.currentTimeMillis();
         rc.syncWrites = ioCount;
         rc.syncWriteDuration = (now-start);
 



Mime
View raw message