metron-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ceste...@apache.org
Subject incubator-metron git commit: METRON-771 Stellar INDEXING_SET_BATCH incorrectly defaults batchSize to 5 closes apache/incubator-metron#485
Date Mon, 27 Mar 2017 13:29:12 GMT
Repository: incubator-metron
Updated Branches:
  refs/heads/master 64ff4694b -> d0965d54d


METRON-771 Stellar INDEXING_SET_BATCH incorrectly defaults batchSize to 5 closes apache/incubator-metron#485


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

Branch: refs/heads/master
Commit: d0965d54d4aec60e3e0cf94df13e81b966159cdb
Parents: 64ff469
Author: mattf-horton <mfoley@hortonworks.com>
Authored: Mon Mar 27 09:29:03 2017 -0400
Committer: cstella <cestella@gmail.com>
Committed: Mon Mar 27 09:29:03 2017 -0400

----------------------------------------------------------------------
 metron-platform/metron-management/README.md                   | 2 +-
 .../org/apache/metron/management/IndexingConfigFunctions.java | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/d0965d54/metron-platform/metron-management/README.md
----------------------------------------------------------------------
diff --git a/metron-platform/metron-management/README.md b/metron-platform/metron-management/README.md
index f3fea80..0cfcac5 100644
--- a/metron-platform/metron-management/README.md
+++ b/metron-platform/metron-management/README.md
@@ -173,7 +173,7 @@ The functions are split roughly into a few sections:
   * Input:
     * sensorConfig - Sensor config to add transformation to.
     * writer - The writer to update (e.g. elasticsearch, solr or hdfs)
-    * size - batch size (integer)
+    * size - batch size (integer), defaults to 1, meaning batching disabled
   * Returns: The String representation of the config in zookeeper
 * `INDEXING_SET_ENABLED`
   * Description: Enable or disable an indexing writer for a sensor.

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/d0965d54/metron-platform/metron-management/src/main/java/org/apache/metron/management/IndexingConfigFunctions.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-management/src/main/java/org/apache/metron/management/IndexingConfigFunctions.java
b/metron-platform/metron-management/src/main/java/org/apache/metron/management/IndexingConfigFunctions.java
index 2755dd0..2c5bc27 100644
--- a/metron-platform/metron-management/src/main/java/org/apache/metron/management/IndexingConfigFunctions.java
+++ b/metron-platform/metron-management/src/main/java/org/apache/metron/management/IndexingConfigFunctions.java
@@ -42,7 +42,7 @@ public class IndexingConfigFunctions {
           ,description = "Set batch size"
           ,params = {"sensorConfig - Sensor config to add transformation to."
                     ,"writer - The writer to update (e.g. elasticsearch, solr or hdfs)"
-                    ,"size - batch size (integer)"
+                    ,"size - batch size (integer), defaults to 1, meaning batching disabled"
                     }
           ,returns = "The String representation of the config in zookeeper"
           )
@@ -69,9 +69,12 @@ public class IndexingConfigFunctions {
       if(writer == null) {
         throw new IllegalStateException("Invalid writer name: " + config);
       }
-      int batchSize = 5;
+      int batchSize = 1;
       if(args.size() > 2) {
         batchSize = ConversionUtils.convert(args.get(i++), Integer.class);
+        if (batchSize < 1) {
+          throw new IllegalArgumentException("Invalid batch size must be >= 1 : " + Integer.toString(batchSize));
+        }
       }
       configObj.put(writer, IndexingConfigurations.setBatchSize((Map<String, Object>)
configObj.get(writer), batchSize));
       try {


Mime
View raw message