You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by kn...@apache.org on 2016/04/01 05:12:02 UTC

[1/3] storm git commit: STORM-1668: Fix silent failing of flux for setting a non-existent property.

Repository: storm
Updated Branches:
  refs/heads/1.x-branch fe50a1b55 -> 97e7d25fe


STORM-1668: Fix silent failing of flux for setting a non-existent property.


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

Branch: refs/heads/1.x-branch
Commit: be09c3c1fd05ec1ed8f8d7768c4023691946d0e2
Parents: 652d2f6
Author: Priyank <ps...@hortonworks.com>
Authored: Wed Mar 30 16:23:05 2016 -0700
Committer: Priyank <ps...@hortonworks.com>
Committed: Wed Mar 30 16:27:12 2016 -0700

----------------------------------------------------------------------
 docs/flux.md                                    |  6 ++--
 external/flux/README.md                         |  6 ++--
 .../java/org/apache/storm/flux/FluxBuilder.java | 29 ++++++++------------
 .../src/test/resources/configs/kafka_test.yaml  |  2 +-
 .../src/main/resources/kafka_spout.yaml         |  2 +-
 5 files changed, 20 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/be09c3c1/docs/flux.md
----------------------------------------------------------------------
diff --git a/docs/flux.md b/docs/flux.md
index 19bb1df..454cad8 100644
--- a/docs/flux.md
+++ b/docs/flux.md
@@ -408,7 +408,7 @@ JavaBean-like setter methods and fields declared as `public`:
       # id
       - "myId"
     properties:
-      - name: "forceFromStart"
+      - name: "ignoreZkOffsets"
         value: true
       - name: "scheme"
         ref: "stringMultiScheme"
@@ -416,7 +416,7 @@ JavaBean-like setter methods and fields declared as `public`:
 
 In the example above, the `properties` declaration will cause Flux to look for a public method in the `SpoutConfig` with
 the signature `setForceFromStart(boolean b)` and attempt to invoke it. If a setter method is not found, Flux will then
-look for a public instance variable with the name `forceFromStart` and attempt to set its value.
+look for a public instance variable with the name `ignoreZkOffsets` and attempt to set its value.
 
 References may also be used as property values.
 
@@ -604,7 +604,7 @@ components:
       # id
       - "myId"
     properties:
-      - name: "forceFromStart"
+      - name: "ignoreZkOffsets"
         value: true
       - name: "scheme"
         ref: "stringMultiScheme"

http://git-wip-us.apache.org/repos/asf/storm/blob/be09c3c1/external/flux/README.md
----------------------------------------------------------------------
diff --git a/external/flux/README.md b/external/flux/README.md
index 7043689..586c3ca 100644
--- a/external/flux/README.md
+++ b/external/flux/README.md
@@ -404,7 +404,7 @@ JavaBean-like setter methods and fields declared as `public`:
       # id
       - "myId"
     properties:
-      - name: "forceFromStart"
+      - name: "ignoreZkOffsets"
         value: true
       - name: "scheme"
         ref: "stringMultiScheme"
@@ -412,7 +412,7 @@ JavaBean-like setter methods and fields declared as `public`:
 
 In the example above, the `properties` declaration will cause Flux to look for a public method in the `SpoutConfig` with
 the signature `setForceFromStart(boolean b)` and attempt to invoke it. If a setter method is not found, Flux will then
-look for a public instance variable with the name `forceFromStart` and attempt to set its value.
+look for a public instance variable with the name `ignoreZkOffsets` and attempt to set its value.
 
 References may also be used as property values.
 
@@ -603,7 +603,7 @@ components:
       # id
       - "myId"
     properties:
-      - name: "forceFromStart"
+      - name: "ignoreZkOffsets"
         value: true
       - name: "scheme"
         ref: "stringMultiScheme"

http://git-wip-us.apache.org/repos/asf/storm/blob/be09c3c1/external/flux/flux-core/src/main/java/org/apache/storm/flux/FluxBuilder.java
----------------------------------------------------------------------
diff --git a/external/flux/flux-core/src/main/java/org/apache/storm/flux/FluxBuilder.java b/external/flux/flux-core/src/main/java/org/apache/storm/flux/FluxBuilder.java
index c16aa05..00e1201 100644
--- a/external/flux/flux-core/src/main/java/org/apache/storm/flux/FluxBuilder.java
+++ b/external/flux/flux-core/src/main/java/org/apache/storm/flux/FluxBuilder.java
@@ -59,7 +59,7 @@ public class FluxBuilder {
      * @throws InvocationTargetException
      */
     public static StormTopology buildTopology(ExecutionContext context) throws IllegalAccessException,
-            InstantiationException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException {
+            InstantiationException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, NoSuchFieldException {
 
         StormTopology topology = null;
         TopologyDef topologyDef = context.getTopologyDef();
@@ -145,7 +145,7 @@ public class FluxBuilder {
      */
     private static void buildStreamDefinitions(ExecutionContext context, TopologyBuilder builder)
             throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException,
-            IllegalAccessException {
+            IllegalAccessException, NoSuchFieldException {
         TopologyDef topologyDef = context.getTopologyDef();
         // process stream definitions
         HashMap<String, BoltDeclarer> declarers = new HashMap<String, BoltDeclarer>();
@@ -219,7 +219,7 @@ public class FluxBuilder {
     }
 
     private static void applyProperties(ObjectDef bean, Object instance, ExecutionContext context) throws
-            IllegalAccessException, InvocationTargetException {
+            IllegalAccessException, InvocationTargetException, NoSuchFieldException {
         List<PropertyDef> props = bean.getProperties();
         Class clazz = instance.getClass();
         if (props != null) {
@@ -242,13 +242,8 @@ public class FluxBuilder {
         }
     }
 
-    private static Field findPublicField(Class clazz, String property, Object arg) {
-        Field field = null;
-        try {
-            field = clazz.getField(property);
-        } catch (NoSuchFieldException e) {
-            LOG.warn("Could not find setter or public variable for property: " + property, e);
-        }
+    private static Field findPublicField(Class clazz, String property, Object arg) throws NoSuchFieldException {
+        Field field = clazz.getField(property);
         return field;
     }
 
@@ -284,7 +279,7 @@ public class FluxBuilder {
     }
 
     private static Object buildObject(ObjectDef def, ExecutionContext context) throws ClassNotFoundException,
-            IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {
+            IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException, NoSuchFieldException {
         Class clazz = Class.forName(def.getClassName());
         Object obj = null;
         if (def.hasConstructorArgs()) {
@@ -313,7 +308,7 @@ public class FluxBuilder {
 
     private static StormTopology buildExternalTopology(ObjectDef def, ExecutionContext context)
             throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException,
-            InvocationTargetException {
+            InvocationTargetException, NoSuchFieldException {
 
         Object topologySource = buildObject(def, context);
 
@@ -330,7 +325,7 @@ public class FluxBuilder {
 
     private static CustomStreamGrouping buildCustomStreamGrouping(ObjectDef def, ExecutionContext context)
             throws ClassNotFoundException,
-            IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {
+            IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException, NoSuchFieldException {
         Object grouping = buildObject(def, context);
         return (CustomStreamGrouping)grouping;
     }
@@ -340,7 +335,7 @@ public class FluxBuilder {
      * keyed by the component id.
      */
     private static void buildComponents(ExecutionContext context) throws ClassNotFoundException, NoSuchMethodException,
-            IllegalAccessException, InvocationTargetException, InstantiationException {
+            IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchFieldException {
         Collection<BeanDef> cDefs = context.getTopologyDef().getComponents();
         if (cDefs != null) {
             for (BeanDef bean : cDefs) {
@@ -352,7 +347,7 @@ public class FluxBuilder {
 
 
     private static void buildSpouts(ExecutionContext context, TopologyBuilder builder) throws ClassNotFoundException,
-            NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
+            NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException, NoSuchFieldException {
         for (SpoutDef sd : context.getTopologyDef().getSpouts()) {
             IRichSpout spout = buildSpout(sd, context);
             builder.setSpout(sd.getId(), spout, sd.getParallelism());
@@ -365,7 +360,7 @@ public class FluxBuilder {
      * in the given spout class. Perform list to array conversion as necessary.
      */
     private static IRichSpout buildSpout(SpoutDef def, ExecutionContext context) throws ClassNotFoundException,
-            IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {
+            IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException, NoSuchFieldException {
         return (IRichSpout)buildObject(def, context);
     }
 
@@ -374,7 +369,7 @@ public class FluxBuilder {
      * Attempt to coerce the given constructor arguments to a matching bolt constructor as much as possible.
      */
     private static void buildBolts(ExecutionContext context) throws ClassNotFoundException, IllegalAccessException,
-            InstantiationException, NoSuchMethodException, InvocationTargetException {
+            InstantiationException, NoSuchMethodException, InvocationTargetException, NoSuchFieldException {
         for (BoltDef def : context.getTopologyDef().getBolts()) {
             Class clazz = Class.forName(def.getClassName());
             Object bolt = buildObject(def, context);

http://git-wip-us.apache.org/repos/asf/storm/blob/be09c3c1/external/flux/flux-core/src/test/resources/configs/kafka_test.yaml
----------------------------------------------------------------------
diff --git a/external/flux/flux-core/src/test/resources/configs/kafka_test.yaml b/external/flux/flux-core/src/test/resources/configs/kafka_test.yaml
index bc01d93..1fb59ca 100644
--- a/external/flux/flux-core/src/test/resources/configs/kafka_test.yaml
+++ b/external/flux/flux-core/src/test/resources/configs/kafka_test.yaml
@@ -61,7 +61,7 @@ components:
       # id
       - "myId"
     properties:
-      - name: "forceFromStart"
+      - name: "ignoreZkOffsets"
         value: true
       - name: "scheme"
         ref: "stringMultiScheme"

http://git-wip-us.apache.org/repos/asf/storm/blob/be09c3c1/external/flux/flux-examples/src/main/resources/kafka_spout.yaml
----------------------------------------------------------------------
diff --git a/external/flux/flux-examples/src/main/resources/kafka_spout.yaml b/external/flux/flux-examples/src/main/resources/kafka_spout.yaml
index db68b1b..7533ce4 100644
--- a/external/flux/flux-examples/src/main/resources/kafka_spout.yaml
+++ b/external/flux/flux-examples/src/main/resources/kafka_spout.yaml
@@ -64,7 +64,7 @@ components:
       # id
       - "myId"
     properties:
-      - name: "forceFromStart"
+      - name: "ignoreZkOffsets"
         value: true
       - name: "scheme"
         ref: "stringMultiScheme"


[2/3] storm git commit: Merge branch 'STORM-1668-1.x' of https://github.com/priyank5485/storm into 1.x-branch

Posted by kn...@apache.org.
Merge branch 'STORM-1668-1.x' of https://github.com/priyank5485/storm into 1.x-branch


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

Branch: refs/heads/1.x-branch
Commit: f2809b4d47489f4ebef08d3b00948dac11c60def
Parents: fe50a1b be09c3c
Author: Kyle Nusbaum <Ky...@gmail.com>
Authored: Thu Mar 31 21:49:48 2016 -0500
Committer: Kyle Nusbaum <Ky...@gmail.com>
Committed: Thu Mar 31 21:49:48 2016 -0500

----------------------------------------------------------------------
 docs/flux.md                                    |  6 ++--
 external/flux/README.md                         |  6 ++--
 .../java/org/apache/storm/flux/FluxBuilder.java | 29 ++++++++------------
 .../src/test/resources/configs/kafka_test.yaml  |  2 +-
 .../src/main/resources/kafka_spout.yaml         |  2 +-
 5 files changed, 20 insertions(+), 25 deletions(-)
----------------------------------------------------------------------



[3/3] storm git commit: Adding STORM-1668 to CHANGELOG.md

Posted by kn...@apache.org.
Adding STORM-1668 to CHANGELOG.md


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/97e7d25f
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/97e7d25f
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/97e7d25f

Branch: refs/heads/1.x-branch
Commit: 97e7d25fe5e94f6e5dca93ad2826835db878877b
Parents: f2809b4
Author: Kyle Nusbaum <Ky...@gmail.com>
Authored: Thu Mar 31 22:01:38 2016 -0500
Committer: Kyle Nusbaum <Ky...@gmail.com>
Committed: Thu Mar 31 22:01:38 2016 -0500

----------------------------------------------------------------------
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/97e7d25f/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 89391a0..54a8489 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## 1.0.0
+ * STORM-1668: Flux silently fails while setting a non-existent property.
  * STORM-1573: Add batch support for MongoInsertBolt
  * STORM-1660: remove flux gitignore file and move rules to top level gitignore
  * STORM-1622: Rename classes with older third party shaded packages