ARTEMIS-3354 journal-max-io cannot be set to 1 with ASYNCIO journal
This commit is contained in:
parent
7fc312ab5d
commit
bb3f31340d
|
@ -112,7 +112,8 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor
|
|||
final IOCriticalErrorListener listener,
|
||||
final CriticalAnalyzer analyzer) {
|
||||
super(journalDir, true, bufferSize, bufferTimeout, maxIO, logRates, listener, analyzer);
|
||||
callbackPool = PlatformDependent.hasUnsafe() ? new MpmcArrayQueue<>(maxIO) : new MpmcAtomicArrayQueue<>(maxIO);
|
||||
final int adjustedMaxIO = Math.max(2, maxIO);
|
||||
callbackPool = PlatformDependent.hasUnsafe() ? new MpmcArrayQueue<>(adjustedMaxIO) : new MpmcAtomicArrayQueue<>(adjustedMaxIO);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("New AIO File Created");
|
||||
}
|
||||
|
|
|
@ -39,6 +39,11 @@ public class AIOSequentialFileFactoryTest extends SequentialFileFactoryTestBase
|
|||
return new AIOSequentialFileFactory(new File(folder), 10);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void canCreateFactoryWithMaxIOLessThenTwo() {
|
||||
AIOSequentialFileFactory factory = new AIOSequentialFileFactory(new File("ignore"), 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBuffer() throws Exception {
|
||||
SequentialFile file = factory.createSequentialFile("filtetmp.log");
|
||||
|
|
Loading…
Reference in New Issue