activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject git commit: Revert "Fix for: https://issues.apache.org/jira/browse/AMQ-4947"
Date Mon, 06 Jan 2014 14:33:15 GMT
Updated Branches:
  refs/heads/trunk ed66e3b34 -> 97b12c724


Revert "Fix for: https://issues.apache.org/jira/browse/AMQ-4947"

This reverts commit c50b6c39babb9e0c4265e632aabf9c38f69c6730.


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

Branch: refs/heads/trunk
Commit: 97b12c7245be24356314fbe333491461eb9b892c
Parents: ed66e3b
Author: Timothy Bish <tabish121@gmai.com>
Authored: Mon Jan 6 09:32:46 2014 -0500
Committer: Timothy Bish <tabish121@gmai.com>
Committed: Mon Jan 6 09:32:46 2014 -0500

----------------------------------------------------------------------
 .../journal/CallerBufferingDataFileAppender.java  |  2 +-
 .../kahadb/disk/journal/DataFileAccessor.java     |  2 +-
 .../kahadb/disk/journal/DataFileAppender.java     |  2 +-
 .../activemq/store/kahadb/disk/page/PageFile.java | 10 +++++-----
 .../store/kahadb/disk/util/DiskBenchmark.java     |  6 +++---
 .../util/RecoverableRandomAccessFile.java         | 18 +-----------------
 6 files changed, 12 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/97b12c72/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/CallerBufferingDataFileAppender.java
----------------------------------------------------------------------
diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/CallerBufferingDataFileAppender.java
b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/CallerBufferingDataFileAppender.java
index a6cce59..ff11848 100644
--- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/CallerBufferingDataFileAppender.java
+++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/CallerBufferingDataFileAppender.java
@@ -155,7 +155,7 @@ class CallerBufferingDataFileAppender extends DataFileAppender {
                 }
                 
                 if (forceToDisk) {
-                	file.getChannel().force(false);
+                    file.getFD().sync();
                 }
 
                 Journal.WriteCommand lastWrite = wb.writes.getTail();

http://git-wip-us.apache.org/repos/asf/activemq/blob/97b12c72/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/DataFileAccessor.java
----------------------------------------------------------------------
diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/DataFileAccessor.java
b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/DataFileAccessor.java
index 11a99dc..7781b7e 100644
--- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/DataFileAccessor.java
+++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/DataFileAccessor.java
@@ -155,7 +155,7 @@ final class DataFileAccessor {
         int size = Math.min(data.getLength(), location.getSize());
         file.write(data.getData(), data.getOffset(), size);
         if (sync) {
-        	file.getChannel().force(false);
+            file.getFD().sync();
         }
 
     }

http://git-wip-us.apache.org/repos/asf/activemq/blob/97b12c72/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/DataFileAppender.java
----------------------------------------------------------------------
diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/DataFileAppender.java
b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/DataFileAppender.java
index 5f73d2a..095db52 100644
--- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/DataFileAppender.java
+++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/DataFileAppender.java
@@ -365,7 +365,7 @@ class DataFileAppender implements FileAppender {
                 }
 
                 if (forceToDisk) {
-                	file.getChannel().force(false);
+                    file.getFD().sync();
                 }
 
                 Journal.WriteCommand lastWrite = wb.writes.getTail();

http://git-wip-us.apache.org/repos/asf/activemq/blob/97b12c72/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/page/PageFile.java
----------------------------------------------------------------------
diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/page/PageFile.java
b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/page/PageFile.java
index 508f698..3f107a6 100644
--- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/page/PageFile.java
+++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/page/PageFile.java
@@ -610,10 +610,10 @@ public class PageFile {
         // So we don't loose it.. write it 2 times...
         writeFile.seek(0);
         writeFile.write(d);
-        writeFile.getChannel().force(false);
+        writeFile.getFD().sync();
         writeFile.seek(PAGE_FILE_HEADER_SIZE / 2);
         writeFile.write(d);
-        writeFile.getChannel().force(false);
+        writeFile.getFD().sync();
     }
 
     private void storeFreeList() throws IOException {
@@ -1081,9 +1081,9 @@ public class PageFile {
             if (enableDiskSyncs) {
                 // Sync to make sure recovery buffer writes land on disk..
                 if (enableRecoveryFile) {
-                	recoveryFile.getChannel().force(false);
+                    recoveryFile.getFD().sync();
                 }
-                writeFile.getChannel().force(false);
+                writeFile.getFD().sync();
             }
         } finally {
             synchronized (writes) {
@@ -1185,7 +1185,7 @@ public class PageFile {
         }
 
         // And sync it to disk
-        writeFile.getChannel().force(false);
+        writeFile.getFD().sync();
         return nextTxId;
     }
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/97b12c72/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 4615fed..2805f5f 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
@@ -233,9 +233,9 @@ public class DiskBenchmark {
             }
             // Sync to disk so that the we actually write the data to disk.. otherwise 
             // OS buffering might not really do the write.
-            raf.getChannel().force(false);
+            raf.getFD().sync();
         }
-        raf.getChannel().force(false);
+        raf.getFD().sync();
         raf.close();
         now = System.currentTimeMillis();
         
@@ -254,7 +254,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.getFD().sync();
                 ioCount++;
                 now = System.currentTimeMillis();
                 if( (now-start)>sampleInterval ) {

http://git-wip-us.apache.org/repos/asf/activemq/blob/97b12c72/activemq-kahadb-store/src/main/java/org/apache/activemq/util/RecoverableRandomAccessFile.java
----------------------------------------------------------------------
diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/util/RecoverableRandomAccessFile.java
b/activemq-kahadb-store/src/main/java/org/apache/activemq/util/RecoverableRandomAccessFile.java
index 5411ca0..35c1586 100644
--- a/activemq-kahadb-store/src/main/java/org/apache/activemq/util/RecoverableRandomAccessFile.java
+++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/util/RecoverableRandomAccessFile.java
@@ -16,12 +16,7 @@
  */
 package org.apache.activemq.util;
 
-import java.io.File;
-import java.io.FileDescriptor;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.nio.channels.FileChannel;
+import java.io.*;
 
 public class RecoverableRandomAccessFile implements java.io.DataOutput, java.io.DataInput,
java.io.Closeable {
 
@@ -393,17 +388,6 @@ public class RecoverableRandomAccessFile implements java.io.DataOutput,
java.io.
             throw ioe;
         }
     }
-    
-    public FileChannel getChannel() throws IOException {
-    	
-    	try {
-    		return getRaf().getChannel();
-        } catch (IOException ioe)
-        {
-            handleException();
-            throw ioe;
-        }
-    }
 
     public int read(byte[] b, int off, int len) throws IOException {
         try {


Mime
View raw message