activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/3] activemq-artemis git commit: ARTEMIS-1266 Mapped Journal refactoring
Date Sat, 01 Jul 2017 01:21:08 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 43dcc572e -> c7af95447


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7075e2e4/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/benchmarks/journal/gcfree/GcFreeJournalLatencyBench.java
----------------------------------------------------------------------
diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/benchmarks/journal/gcfree/GcFreeJournalLatencyBench.java
b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/benchmarks/journal/gcfree/GcFreeJournalLatencyBench.java
deleted file mode 100644
index 9b72f15..0000000
--- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/benchmarks/journal/gcfree/GcFreeJournalLatencyBench.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.tests.extras.benchmarks.journal.gcfree;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.file.Files;
-import java.util.ArrayList;
-
-import net.openhft.chronicle.core.jlbh.JLBH;
-import net.openhft.chronicle.core.jlbh.JLBHOptions;
-import net.openhft.chronicle.core.jlbh.JLBHTask;
-import org.apache.activemq.artemis.core.io.IOCriticalErrorListener;
-import org.apache.activemq.artemis.core.io.SequentialFileFactory;
-import org.apache.activemq.artemis.core.io.mapped.MappedSequentialFileFactory;
-import org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory;
-import org.apache.activemq.artemis.core.journal.RecordInfo;
-import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
-
-public class GcFreeJournalLatencyBench implements JLBHTask {
-
-   private static final int FILE_SIZE = JournalImpl.SIZE_HEADER + (1024 * 1024 * 1024);
-   private static final JournalType JOURNAL_TYPE = JournalType.MAPPED;
-   private static final int ITERATIONS = 100_000;
-   private static final int WARMUP_ITERATIONS = 20_000;
-   private static final int TARGET_THROUGHPUT = 500_000;
-   private static final int TESTS = 5;
-   private static int TOTAL_MESSAGES = (ITERATIONS * TESTS + WARMUP_ITERATIONS);
-   private static int ENCODED_SIZE = 8;
-   private static int CHUNK_BYTES = FILE_SIZE;
-   private static int OVERLAP_BYTES = CHUNK_BYTES / 4;
-   private final SequentialFileFactory sequentialFileFactory;
-   private GcFreeJournal journal;
-   private JLBH jlbh;
-   private long id;
-   private ByteBuffer encodedRecord;
-
-   public GcFreeJournalLatencyBench(SequentialFileFactory sequentialFileFactory) {
-      this.sequentialFileFactory = sequentialFileFactory;
-   }
-
-   public static void main(String[] args) throws IOException {
-      final File journalDir = Files.createTempDirectory("seq_files").toFile();
-      journalDir.deleteOnExit();
-      final boolean buffered = false;
-      final int bufferSize = 4096;
-      final int bufferTimeout = 0;
-      final int maxIO = -1;
-      final boolean logRates = false;
-      final IOCriticalErrorListener criticalErrorListener = null;
-      final SequentialFileFactory sequentialFileFactory;
-      switch (JOURNAL_TYPE) {
-         case MAPPED:
-            sequentialFileFactory = new MappedSequentialFileFactory(journalDir, criticalErrorListener).chunkBytes(CHUNK_BYTES).overlapBytes(OVERLAP_BYTES);
-            break;
-         case NIO:
-            sequentialFileFactory = new NIOSequentialFileFactory(journalDir, buffered, bufferSize,
bufferTimeout, maxIO, logRates, criticalErrorListener);
-            break;
-
-         default:
-            throw new AssertionError("!?");
-      }
-      final JLBHOptions lth = new JLBHOptions().warmUpIterations(WARMUP_ITERATIONS).iterations(ITERATIONS).throughput(TARGET_THROUGHPUT).runs(TESTS).recordOSJitter(true).accountForCoordinatedOmmission(true).jlbhTask(new
GcFreeJournalLatencyBench(sequentialFileFactory));
-      new JLBH(lth).start();
-   }
-
-   @Override
-   public void init(JLBH jlbh) {
-      id = 0;
-      this.jlbh = jlbh;
-      final int expectedMaxSize = GcFreeJournal.align(JournalRecordHeader.BYTES + AddJournalRecordEncoder.expectedSize(ENCODED_SIZE),
8);
-      int numFiles = (int) ((TOTAL_MESSAGES * expectedMaxSize + 512) / FILE_SIZE * 1.3);
-      if (numFiles < 2) {
-         numFiles = 2;
-      }
-      this.encodedRecord = ByteBuffer.allocateDirect(ENCODED_SIZE);
-      this.encodedRecord.order(ByteOrder.nativeOrder());
-      this.journal = new GcFreeJournal(FILE_SIZE, numFiles, numFiles, 0, 0, sequentialFileFactory,
"activemq-data", "amq", Integer.MAX_VALUE);
-      try {
-         journal.start();
-         journal.load(new ArrayList<RecordInfo>(), null, null);
-      } catch (Exception e) {
-         throw new RuntimeException(e);
-      }
-
-   }
-
-   @Override
-   public void run(long startTimeNS) {
-      id++;
-      try {
-         journal.appendAddRecord(id, (byte) 0, encodedRecord, 0, ENCODED_SIZE, false);
-      } catch (Exception e) {
-         throw new RuntimeException(e);
-      }
-      jlbh.sample(System.nanoTime() - startTimeNS);
-   }
-
-   @Override
-   public void complete() {
-      try {
-         journal.stop();
-         for (File journalFile : sequentialFileFactory.getDirectory().listFiles()) {
-            journalFile.deleteOnExit();
-         }
-      } catch (Exception e) {
-         throw new RuntimeException(e);
-      }
-   }
-
-   private enum JournalType {
-      MAPPED,
-      NIO
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7075e2e4/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/benchmarks/journal/gcfree/JournalRecordHeader.java
----------------------------------------------------------------------
diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/benchmarks/journal/gcfree/JournalRecordHeader.java
b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/benchmarks/journal/gcfree/JournalRecordHeader.java
deleted file mode 100644
index 98b205e..0000000
--- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/benchmarks/journal/gcfree/JournalRecordHeader.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.tests.extras.benchmarks.journal.gcfree;
-
-final class JournalRecordHeader {
-
-   public static final int BYTES = 8;
-
-   public static long makeHeader(final int journalRecordTypeId, final int length) {
-      return ((journalRecordTypeId & 0xFFFF_FFFFL) << 32) | (length & 0xFFFF_FFFFL);
-   }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7075e2e4/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/benchmarks/journal/gcfree/JournalRecordTypes.java
----------------------------------------------------------------------
diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/benchmarks/journal/gcfree/JournalRecordTypes.java
b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/benchmarks/journal/gcfree/JournalRecordTypes.java
deleted file mode 100644
index ece9b3a..0000000
--- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/benchmarks/journal/gcfree/JournalRecordTypes.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.tests.extras.benchmarks.journal.gcfree;
-
-/**
- * Created by developer on 18/06/16.
- */
-final class JournalRecordTypes {
-
-   public static final int ADD_JOURNAL = 11;
-
-   private JournalRecordTypes() {
-
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7075e2e4/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/benchmarks/sequentialfile/SequentialFileLatencyBench.java
----------------------------------------------------------------------
diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/benchmarks/sequentialfile/SequentialFileLatencyBench.java
b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/benchmarks/sequentialfile/SequentialFileLatencyBench.java
deleted file mode 100644
index 343d95d..0000000
--- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/benchmarks/sequentialfile/SequentialFileLatencyBench.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.activemq.artemis.tests.extras.benchmarks.sequentialfile;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-
-import net.openhft.chronicle.core.jlbh.JLBH;
-import net.openhft.chronicle.core.jlbh.JLBHOptions;
-import net.openhft.chronicle.core.jlbh.JLBHTask;
-import org.apache.activemq.artemis.core.io.DummyCallback;
-import org.apache.activemq.artemis.core.io.IOCriticalErrorListener;
-import org.apache.activemq.artemis.core.io.SequentialFile;
-import org.apache.activemq.artemis.core.io.SequentialFileFactory;
-import org.apache.activemq.artemis.core.io.mapped.MappedSequentialFileFactory;
-import org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory;
-
-public final class SequentialFileLatencyBench implements JLBHTask {
-
-   private static final JournalType JOURNAL_TYPE = JournalType.MAPPED;
-   //NOTE: SUPPORTED ONLY ON *NIX
-   private static final boolean SHM = false;
-   private static final int JOURNAL_RECORD_SIZE = 8;
-   private static final int ITERATIONS = 100_000;
-   private static final int WARMUP_ITERATIONS = 20_000;
-   private static final int TARGET_THROUGHPUT = 500_000;
-   private static final int TESTS = 5;
-   private static int CHUNK_BYTES = 4096 * 1024 * 16;
-   private static int OVERLAP_BYTES = CHUNK_BYTES / 4;
-   private final SequentialFileFactory sequentialFileFactory;
-   private SequentialFile sequentialFile;
-   private ByteBuffer message;
-   private JLBH jlbh;
-
-   public SequentialFileLatencyBench(SequentialFileFactory sequentialFileFactory) {
-      this.sequentialFileFactory = sequentialFileFactory;
-   }
-
-   public static void main(String[] args) throws IOException {
-      final File journalDir;
-      if (SHM) {
-         journalDir = Files.createDirectory(Paths.get("/dev/shm/seq_files")).toFile();
-      } else {
-         journalDir = Files.createTempDirectory("seq_files").toFile();
-      }
-      journalDir.deleteOnExit();
-      final boolean buffered = false;
-      final int bufferSize = 4096;
-      final int bufferTimeout = 0;
-      final int maxIO = -1;
-      final boolean logRates = false;
-      final IOCriticalErrorListener criticalErrorListener = null;
-      final SequentialFileFactory sequentialFileFactory;
-      switch (JOURNAL_TYPE) {
-         case MAPPED:
-            sequentialFileFactory = new MappedSequentialFileFactory(journalDir).chunkBytes(CHUNK_BYTES).overlapBytes(OVERLAP_BYTES);
-            break;
-         case NIO:
-            sequentialFileFactory = new NIOSequentialFileFactory(journalDir, buffered, bufferSize,
bufferTimeout, maxIO, logRates, criticalErrorListener);
-            break;
-         default:
-            throw new AssertionError("!?");
-      }
-      final JLBHOptions lth = new JLBHOptions().warmUpIterations(WARMUP_ITERATIONS).iterations(ITERATIONS).throughput(TARGET_THROUGHPUT).runs(TESTS).recordOSJitter(true).accountForCoordinatedOmmission(true).jlbhTask(new
SequentialFileLatencyBench(sequentialFileFactory));
-      new JLBH(lth).start();
-   }
-
-   @Override
-   public void init(JLBH jlbh) {
-      this.jlbh = jlbh;
-      this.sequentialFile = this.sequentialFileFactory.createSequentialFile(Long.toString(System.nanoTime()));
-      try {
-         this.sequentialFile.open(-1, false);
-         final File file = this.sequentialFile.getJavaFile();
-         file.deleteOnExit();
-         System.out.println("sequentialFile: " + file);
-      } catch (Exception e) {
-         throw new RuntimeException(e);
-      }
-      this.message = this.sequentialFileFactory.allocateDirectBuffer(JOURNAL_RECORD_SIZE).order(ByteOrder.nativeOrder());
-
-   }
-
-   @Override
-   public void run(long startTimeNS) {
-      message.position(0);
-      try {
-         sequentialFile.writeDirect(message, false, DummyCallback.getInstance());
-      } catch (Exception e) {
-         throw new RuntimeException(e);
-      }
-      jlbh.sample(System.nanoTime() - startTimeNS);
-   }
-
-   @Override
-   public void complete() {
-      sequentialFileFactory.releaseDirectBuffer(message);
-      try {
-         sequentialFile.close();
-      } catch (Exception e) {
-         throw new RuntimeException(e);
-      }
-   }
-
-   private enum JournalType {
-      MAPPED,
-      NIO
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7075e2e4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedImportExportTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedImportExportTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedImportExportTest.java
index 5d54060..3ca3a90 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedImportExportTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedImportExportTest.java
@@ -23,8 +23,26 @@ import org.apache.activemq.artemis.core.io.mapped.MappedSequentialFileFactory;
 public class MappedImportExportTest extends NIOImportExportTest {
 
    @Override
+   protected void setup(int minFreeFiles, int fileSize, boolean sync) {
+      super.setup(minFreeFiles, fileSize, sync);
+      ((MappedSequentialFileFactory) this.fileFactory).capacity(fileSize);
+   }
+
+   @Override
+   protected void setup(int minFreeFiles, int fileSize, boolean sync, int maxAIO) {
+      super.setup(minFreeFiles, fileSize, sync, maxAIO);
+      ((MappedSequentialFileFactory) this.fileFactory).capacity(fileSize);
+   }
+
+   @Override
+   protected void setup(int minFreeFiles, int poolSize, int fileSize, boolean sync, int maxAIO)
{
+      super.setup(minFreeFiles, poolSize, fileSize, sync, maxAIO);
+      ((MappedSequentialFileFactory) this.fileFactory).capacity(fileSize);
+   }
+
+   @Override
    protected SequentialFileFactory getFileFactory() throws Exception {
-      return new MappedSequentialFileFactory(getTestDirfile());
+      return MappedSequentialFileFactory.unbuffered(getTestDirfile(), 10 * 4096, null);
    }
 }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7075e2e4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedJournalCompactTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedJournalCompactTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedJournalCompactTest.java
index 32b4b8f..f333f6c 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedJournalCompactTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedJournalCompactTest.java
@@ -25,6 +25,24 @@ import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 public class MappedJournalCompactTest extends NIOJournalCompactTest {
 
    @Override
+   protected void setup(int minFreeFiles, int fileSize, boolean sync) {
+      super.setup(minFreeFiles, fileSize, sync);
+      ((MappedSequentialFileFactory) this.fileFactory).capacity(fileSize);
+   }
+
+   @Override
+   protected void setup(int minFreeFiles, int fileSize, boolean sync, int maxAIO) {
+      super.setup(minFreeFiles, fileSize, sync, maxAIO);
+      ((MappedSequentialFileFactory) this.fileFactory).capacity(fileSize);
+   }
+
+   @Override
+   protected void setup(int minFreeFiles, int poolSize, int fileSize, boolean sync, int maxAIO)
{
+      super.setup(minFreeFiles, poolSize, fileSize, sync, maxAIO);
+      ((MappedSequentialFileFactory) this.fileFactory).capacity(fileSize);
+   }
+
+   @Override
    protected SequentialFileFactory getFileFactory() throws Exception {
       File file = new File(getTestDir());
 
@@ -32,6 +50,6 @@ public class MappedJournalCompactTest extends NIOJournalCompactTest {
 
       file.mkdir();
 
-      return new MappedSequentialFileFactory(getTestDirfile());
+      return MappedSequentialFileFactory.unbuffered(getTestDirfile(), 60 * 1024, null);
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7075e2e4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedJournalImplTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedJournalImplTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedJournalImplTest.java
index 940c8a6..f59ef36 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedJournalImplTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedJournalImplTest.java
@@ -25,6 +25,24 @@ import org.apache.activemq.artemis.tests.unit.core.journal.impl.JournalImplTestU
 public class MappedJournalImplTest extends JournalImplTestUnit {
 
    @Override
+   protected void setup(int minFreeFiles, int fileSize, boolean sync) {
+      super.setup(minFreeFiles, fileSize, sync);
+      ((MappedSequentialFileFactory) this.fileFactory).capacity(fileSize);
+   }
+
+   @Override
+   protected void setup(int minFreeFiles, int fileSize, boolean sync, int maxAIO) {
+      super.setup(minFreeFiles, fileSize, sync, maxAIO);
+      ((MappedSequentialFileFactory) this.fileFactory).capacity(fileSize);
+   }
+
+   @Override
+   protected void setup(int minFreeFiles, int poolSize, int fileSize, boolean sync, int maxAIO)
{
+      super.setup(minFreeFiles, poolSize, fileSize, sync, maxAIO);
+      ((MappedSequentialFileFactory) this.fileFactory).capacity(fileSize);
+   }
+
+   @Override
    protected SequentialFileFactory getFileFactory() throws Exception {
       File file = new File(getTestDir());
 
@@ -32,7 +50,7 @@ public class MappedJournalImplTest extends JournalImplTestUnit {
 
       file.mkdir();
 
-      return new MappedSequentialFileFactory(getTestDirfile());
+      return MappedSequentialFileFactory.unbuffered(getTestDirfile(), 10 * 1024, null);
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7075e2e4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedSequentialFileFactoryTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedSequentialFileFactoryTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedSequentialFileFactoryTest.java
index cf87cde..5684147 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedSequentialFileFactoryTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/MappedSequentialFileFactoryTest.java
@@ -34,7 +34,7 @@ public class MappedSequentialFileFactoryTest extends SequentialFileFactoryTestBa
 
    @Override
    protected SequentialFileFactory createFactory(String folder) {
-      return new MappedSequentialFileFactory(new File(folder));
+      return MappedSequentialFileFactory.unbuffered(new File(folder), 2048, null);
    }
 
    @Test
@@ -58,7 +58,7 @@ public class MappedSequentialFileFactoryTest extends SequentialFileFactoryTestBa
       };
 
       final AtomicInteger calls = new AtomicInteger(0);
-      final MappedSequentialFileFactory factory = new MappedSequentialFileFactory(new File(getTestDir()),
(code, message, file) -> {
+      final MappedSequentialFileFactory factory = MappedSequentialFileFactory.unbuffered(new
File(getTestDir()), fakeEncoding.getEncodeSize(), (code, message, file) -> {
          new Exception("shutdown").printStackTrace();
          calls.incrementAndGet();
       });

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7075e2e4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java
index d2ffd6f..4019d8d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java
@@ -22,8 +22,6 @@ import java.util.List;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.activemq.artemis.ArtemisConstants;
-import org.apache.activemq.artemis.core.io.IOCriticalErrorListener;
-import org.apache.activemq.artemis.core.io.SequentialFile;
 import org.apache.activemq.artemis.core.io.SequentialFileFactory;
 import org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory;
 import org.apache.activemq.artemis.core.io.mapped.MappedSequentialFileFactory;
@@ -354,12 +352,7 @@ public class ValidateTransactionHealthTest extends ActiveMQTestBase {
       } else if (factoryType.equals("nio2")) {
          return new NIOSequentialFileFactory(new File(directory), true, 1);
       } else if (factoryType.equals("mmap")) {
-         return new MappedSequentialFileFactory(new File(directory), new IOCriticalErrorListener()
{
-            @Override
-            public void onIOException(Throwable code, String message, SequentialFile file)
{
-               code.printStackTrace();
-            }
-         }, true).chunkBytes(fileSize).overlapBytes(0);
+         return MappedSequentialFileFactory.unbuffered(new File(directory), fileSize, null);
       } else {
          return new NIOSequentialFileFactory(new File(directory), false, 1);
       }


Mime
View raw message