You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ce...@apache.org on 2015/02/20 17:23:44 UTC

activemq git commit: Fix for https://issues.apache.org/jira/browse/AMQ-5551 The DiskBenchmark util doesn't sync (fsync) to disk for sync writes

Repository: activemq
Updated Branches:
  refs/heads/master 4c272e308 -> 2c92c3413


Fix for https://issues.apache.org/jira/browse/AMQ-5551 The DiskBenchmark util doesn't sync (fsync) to disk for sync writes


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/2c92c341
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/2c92c341
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/2c92c341

Branch: refs/heads/master
Commit: 2c92c34132d72f013ffe4a867187099714f7b231
Parents: 4c272e3
Author: Christian Posta <ch...@gmail.com>
Authored: Fri Feb 20 09:23:12 2015 -0700
Committer: Christian Posta <ch...@gmail.com>
Committed: Fri Feb 20 09:23:12 2015 -0700

----------------------------------------------------------------------
 .../apache/activemq/store/kahadb/disk/util/DiskBenchmark.java  | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/2c92c341/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/util/DiskBenchmark.java
----------------------------------------------------------------------
diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/util/DiskBenchmark.java b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/util/DiskBenchmark.java
index 4cffa6b..de0a41b 100644
--- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/util/DiskBenchmark.java
+++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/util/DiskBenchmark.java
@@ -54,7 +54,7 @@ public class DiskBenchmark {
             try {
                 File file = new File(f);
                 if (file.exists()) {
-                    System.out.println("File " + file + " allready exists, will not benchmark.");
+                    System.out.println("File " + file + " already exists, will not benchmark.");
                 } else {
                     System.out.println("Benchmarking: " + file.getCanonicalPath());
                     Report report = benchmark.benchmark(file);
@@ -206,7 +206,6 @@ public class DiskBenchmark {
 
         rc.size = data.length;
         RecoverableRandomAccessFile raf = new RecoverableRandomAccessFile(file, "rw");
-//        RandomAccessFile raf = new RandomAccessFile(file, "rw");
         preallocateDataFile(raf, file.getParentFile());
 
         // Figure out how many writes we can do in the sample interval.
@@ -249,7 +248,7 @@ public class DiskBenchmark {
             for (long i = 0; i + data.length < size; i += data.length) {
                 raf.seek(i);
                 raf.write(data);
-                raf.getChannel().force(false);
+                raf.getChannel().force(!SKIP_METADATA_UPDATE);
                 ioCount++;
                 now = System.currentTimeMillis();
                 if ((now - start) > sampleInterval) {
@@ -298,7 +297,6 @@ public class DiskBenchmark {
         if (tmpFile.exists()) {
             tmpFile.delete();
         }
-        System.out.println("Using a template file: " + tmpFile.getAbsolutePath());
         RandomAccessFile templateFile = new RandomAccessFile(tmpFile, "rw");
         templateFile.setLength(size);
         templateFile.getChannel().force(true);