streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sblack...@apache.org
Subject git commit: more consistent logging / exception handling
Date Fri, 12 Sep 2014 21:02:15 GMT
Repository: incubator-streams
Updated Branches:
  refs/heads/STREAMS-164 63e2d428a -> 9c98a4501


more consistent logging / exception handling


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

Branch: refs/heads/STREAMS-164
Commit: 9c98a450115f7e136d002c2df311aeebc3f860fe
Parents: 63e2d42
Author: sblackmon <sblackmon@apache.org>
Authored: Fri Sep 12 16:01:39 2014 -0500
Committer: sblackmon <sblackmon@apache.org>
Committed: Fri Sep 12 16:01:39 2014 -0500

----------------------------------------------------------------------
 .../streams/elasticsearch/ElasticsearchPersistDeleter.java     | 6 +++---
 .../streams/elasticsearch/ElasticsearchPersistUpdater.java     | 6 ++----
 .../streams/elasticsearch/ElasticsearchPersistWriter.java      | 4 ++++
 3 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/9c98a450/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchPersistDeleter.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchPersistDeleter.java
b/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchPersistDeleter.java
index 9bb585c..95004f5 100644
--- a/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchPersistDeleter.java
+++ b/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchPersistDeleter.java
@@ -45,11 +45,11 @@ public class ElasticsearchPersistDeleter extends ElasticsearchPersistWriter
impl
         if(streamsDatum == null || streamsDatum.getDocument() == null)
             return;
 
-        LOGGER.debug("Update Document: {}", streamsDatum.getDocument());
+        LOGGER.debug("Delete Document: {}", streamsDatum.getDocument());
 
         Map<String, Object> metadata = streamsDatum.getMetadata();
 
-        LOGGER.debug("Update Metadata: {}", metadata);
+        LOGGER.debug("Delete Metadata: {}", metadata);
 
         String index = null;
         String type = null;
@@ -72,7 +72,7 @@ public class ElasticsearchPersistDeleter extends ElasticsearchPersistWriter
impl
         try {
             delete(index, type, id);
         } catch (Throwable e) {
-            LOGGER.warn("Unable to Delete Datum from ElasticSearch: {}", e.getMessage());
+            LOGGER.warn("Unable to Delete Document from ElasticSearch: {}", e.getMessage());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/9c98a450/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchPersistUpdater.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchPersistUpdater.java
b/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchPersistUpdater.java
index b8584e5..d0e8acd 100644
--- a/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchPersistUpdater.java
+++ b/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchPersistUpdater.java
@@ -78,10 +78,8 @@ public class ElasticsearchPersistUpdater extends ElasticsearchPersistWriter
impl
 
             update(index, type, id, json);
 
-        } catch (Exception e) {
-            LOGGER.warn("Exception: {} ", e.getMessage());
-        } catch (Error e) {
-            LOGGER.warn("Error: {} ", e.getMessage());
+        } catch (Throwable e) {
+            LOGGER.warn("Unable to Update Document in ElasticSearch: {}", e.getMessage());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/9c98a450/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 169c941..ca643b9 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
@@ -139,8 +139,12 @@ public class ElasticsearchPersistWriter implements StreamsPersistWriter,
DatumSt
 
         checkForBackOff();
 
+        LOGGER.debug("Write Document: {}", streamsDatum.getDocument());
+
         Map<String, Object> metadata = streamsDatum.getMetadata();
 
+        LOGGER.debug("Write Metadata: {}", metadata);
+
         String index = null;
         String type = null;
         String id = streamsDatum.getId();


Mime
View raw message