Repository: activemq
Updated Branches:
  refs/heads/master e89b7a57f -> e8f44a29d


https://issues.apache.org/jira/browse/AMQ-5578

Revert to previous behavior of explicit init. 

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

Branch: refs/heads/master
Commit: e8f44a29ddf940a3bd254b10336c8e2c1f318fc7
Parents: e89b7a5
Author: Timothy Bish <[email protected]>
Authored: Wed Mar 2 17:18:30 2016 -0500
Committer: Timothy Bish <[email protected]>
Committed: Wed Mar 2 17:18:30 2016 -0500

----------------------------------------------------------------------
 .../apache/activemq/store/kahadb/disk/journal/Journal.java    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/e8f44a29/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/Journal.java
----------------------------------------------------------------------
diff --git 
a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/Journal.java
 
b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/Journal.java
index ba0b9f5..2604e39 100644
--- 
a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/Journal.java
+++ 
b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/Journal.java
@@ -275,7 +275,12 @@ public class Journal {
 
     private void doPreallocationZeros(RecoverableRandomAccessFile file) {
         ByteBuffer buffer = ByteBuffer.allocate(maxFileLength);
-        buffer.limit(maxFileLength);
+        // intentional double initialization due to interaction with the OS 
level
+        // file allocation mechanics.
+        for (int i = 0; i < maxFileLength; i++) {
+            buffer.put((byte) 0x00);
+        }
+        buffer.flip();
 
         try {
             FileChannel channel = file.getChannel();

Reply via email to