streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robdouglas <...@git.apache.org>
Subject [GitHub] incubator-streams pull request: Streams 164
Date Tue, 16 Sep 2014 18:28:38 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message