IGNITE-10800 Added WAL mode parameter and warning message - Fixes #5734.
authoroleg-ostanin <oostanin@gridagin.com>
Fri, 28 Dec 2018 12:43:07 +0000 (15:43 +0300)
committerAlexey Goncharuk <alexey.goncharuk@gmail.com>
Fri, 28 Dec 2018 12:43:07 +0000 (15:43 +0300)
Signed-off-by: Alexey Goncharuk <alexey.goncharuk@gmail.com>
modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java
modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteNode.java

index 4f8b83b..72cb486 100644 (file)
@@ -251,6 +251,10 @@ public class IgniteBenchmarkArguments {
     private boolean persistentStoreEnabled;
 
     /** */
+    @Parameter(names = {"-wm", "--walMode"}, description = "WAL mode")
+    private String walMode = "LOG_ONLY";
+
+    /** */
     @Parameter(names = {"-stcp", "--streamerCachesPrefix"}, description = "Cache name prefix for streamer benchmark")
     private String streamerCachesPrefix = "streamer";
 
@@ -302,6 +306,13 @@ public class IgniteBenchmarkArguments {
     }
 
     /**
+     * @return Wal mode.
+     */
+    public String walMode() {
+        return walMode;
+    }
+
+    /**
      * @return List of enabled load test operations.
      */
     public List<String> allowedLoadTestOps() {
index 4698e86..e107f78 100644 (file)
@@ -32,6 +32,7 @@ import org.apache.ignite.configuration.DataStorageConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.configuration.NearCacheConfiguration;
 import org.apache.ignite.configuration.TransactionConfiguration;
+import org.apache.ignite.configuration.WALMode;
 import org.apache.ignite.internal.util.IgniteUtils;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiTuple;
@@ -180,10 +181,15 @@ public class IgniteNode implements BenchmarkServer {
         // Set data storage configuration with persistence only if there is no data storage configuration
         // in configuration file.
         if (args.persistentStoreEnabled() && c.getDataStorageConfiguration() == null) {
+            BenchmarkUtils.println(String.format("Setting 'persistenceEnabled' property to 'true'. WAL mode is %s",
+                args.walMode()));
+
             DataStorageConfiguration pcCfg = new DataStorageConfiguration();
 
             pcCfg.getDefaultDataRegionConfiguration().setPersistenceEnabled(true);
 
+            pcCfg.setWalMode(WALMode.valueOf(args.walMode()));
+
             c.setBinaryConfiguration(new BinaryConfiguration().setCompactFooter(false));
 
             c.setDataStorageConfiguration(pcCfg);