From 800cc461ca7be67bd3bed3241655d6f12e5315a8 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Wed, 12 Aug 2015 14:46:46 -0400 Subject: [PATCH] forcing libaio option --- .../org/apache/activemq/artemis/cli/commands/Create.java | 9 ++++++++- .../activemq/artemis/maven/ArtemisCreatePlugin.java | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java index 6262fd2934..8a2d60e00f 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java @@ -157,6 +157,9 @@ public class Create extends InputAbstract { @Option(name = "--topics", description = "comma separated list of jms topics ") String topics; + @Option(name = "--aio", description = "Force aio journal on the configuration regardless of the library being available or not.") + boolean forceLibaio; + boolean IS_WINDOWS; boolean IS_CYGWIN; @@ -665,7 +668,11 @@ public class Create extends InputAbstract { } private boolean supportsLibaio() { - if (LibaioContext.isLoaded()) { + if (forceLibaio) { + // forcing libaio + return true; + } + else if (LibaioContext.isLoaded()) { try (LibaioContext context = new LibaioContext(1, true)) { File tmpFile = new File(directory, "validateAIO.bin"); boolean supportsLibaio = true; diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCreatePlugin.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCreatePlugin.java index acb9466354..a60c341982 100644 --- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCreatePlugin.java +++ b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCreatePlugin.java @@ -251,6 +251,10 @@ public class ArtemisCreatePlugin extends ArtemisAbstractPlugin { add(listCommands, "--verbose"); + if ("Linux".equals(System.getProperty("os.name"))) { + add(listCommands, "--aio"); + } + for (String str : args) { add(listCommands, str); }