You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streams.apache.org by sb...@apache.org on 2014/08/05 17:35:10 UTC

git commit: added explicit check for ObjectNode document type

Repository: incubator-streams
Updated Branches:
  refs/heads/STREAMS-134 767f94558 -> 99dc53206


added explicit check for ObjectNode document type


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

Branch: refs/heads/STREAMS-134
Commit: 99dc5320651ea6036be803adad2d295f0214d2b6
Parents: 767f945
Author: sblackmon <sb...@w2odigital.com>
Authored: Tue Aug 5 10:35:08 2014 -0500
Committer: sblackmon <sb...@w2odigital.com>
Committed: Tue Aug 5 10:35:08 2014 -0500

----------------------------------------------------------------------
 .../streams/elasticsearch/processor/PercolateTagProcessor.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/99dc5320/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/processor/PercolateTagProcessor.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/processor/PercolateTagProcessor.java b/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/processor/PercolateTagProcessor.java
index eddc99b..389f390 100644
--- a/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/processor/PercolateTagProcessor.java
+++ b/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/processor/PercolateTagProcessor.java
@@ -122,7 +122,7 @@ public class PercolateTagProcessor implements StreamsProcessor {
                 e.printStackTrace();
                 return null;
             }
-        } else {
+        } else if (entry.getDocument() instanceof ObjectNode) {
             node = (ObjectNode) entry.getDocument();
             try {
                 json = mapper.writeValueAsString(node);
@@ -130,6 +130,9 @@ public class PercolateTagProcessor implements StreamsProcessor {
                 LOGGER.warn("Invalid datum: ", node);
                 return null;
             }
+        } else {
+            LOGGER.warn("Incompatible document type: ", entry.getDocument().getClass());
+            return null;
         }
 
         StringBuilder percolateRequestJson = new StringBuilder();