streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfrank...@apache.org
Subject git commit: STREAMS-150 | If an ID does not exist in the datum's metadata, then we'll use the datum's ID.
Date Tue, 19 Aug 2014 00:21:43 GMT
Repository: incubator-streams
Updated Branches:
  refs/heads/master 92a8bef2a -> ee6b4d551


STREAMS-150 | If an ID does not exist in the datum's metadata, then we'll use the datum's
ID.


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

Branch: refs/heads/master
Commit: ee6b4d551f4d03c5d52ccf3484627064d38030d0
Parents: 92a8bef
Author: Robert Douglas <rdouglas@w2odigital.com>
Authored: Mon Aug 18 19:01:48 2014 -0500
Committer: Robert Douglas <rdouglas@w2odigital.com>
Committed: Mon Aug 18 19:01:48 2014 -0500

----------------------------------------------------------------------
 .../apache/streams/elasticsearch/ElasticsearchPersistWriter.java  | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/ee6b4d55/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchPersistWriter.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchPersistWriter.java
b/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchPersistWriter.java
index d9b1f90..8a14181 100644
--- a/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchPersistWriter.java
+++ b/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchPersistWriter.java
@@ -152,6 +152,9 @@ public class ElasticsearchPersistWriter implements StreamsPersistWriter,
DatumSt
                 .or(config.getType());
         String id = (String) streamsDatum.getMetadata().get("id");
 
+        if(id == null)
+            id = streamsDatum.getId();
+
         try {
             add(index, type, id,
                     streamsDatum.getTimestamp() == null ? Long.toString(DateTime.now().getMillis())
: Long.toString(streamsDatum.getTimestamp().getMillis()),


Mime
View raw message