Github user robdouglas commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/83#discussion_r17620640
  
    --- Diff: 
streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchPersistUpdater.java
 ---
    @@ -71,32 +42,44 @@ public 
ElasticsearchPersistUpdater(ElasticsearchWriterConfiguration config) {
         @Override
         public void write(StreamsDatum streamsDatum) {
     
    -        Preconditions.checkNotNull(streamsDatum);
    -        Preconditions.checkNotNull(streamsDatum.getDocument());
    -        Preconditions.checkNotNull(streamsDatum.getMetadata());
    -        Preconditions.checkNotNull(streamsDatum.getMetadata().get("id"));
    +        if(streamsDatum == null || streamsDatum.getDocument() == null)
    +            return;
    +
    +        LOGGER.debug("Update Document: {}", streamsDatum.getDocument());
    --- End diff --
    
    It seems like this block of logic is being used in more than one place. Do 
you think it could be abstracted elsewhere?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to