Return-Path: X-Original-To: apmail-streams-dev-archive@minotaur.apache.org Delivered-To: apmail-streams-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CECA61195C for ; Tue, 16 Sep 2014 18:29:03 +0000 (UTC) Received: (qmail 66130 invoked by uid 500); 16 Sep 2014 18:29:03 -0000 Delivered-To: apmail-streams-dev-archive@streams.apache.org Received: (qmail 66085 invoked by uid 500); 16 Sep 2014 18:29:03 -0000 Mailing-List: contact dev-help@streams.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@streams.incubator.apache.org Delivered-To: mailing list dev@streams.incubator.apache.org Received: (qmail 66068 invoked by uid 99); 16 Sep 2014 18:29:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2014 18:29:03 +0000 X-ASF-Spam-Status: No, hits=-2000.7 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 16 Sep 2014 18:28:41 +0000 Received: (qmail 65765 invoked by uid 99); 16 Sep 2014 18:28:39 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2014 18:28:39 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id F0E45A1681F; Tue, 16 Sep 2014 18:28:38 +0000 (UTC) From: robdouglas To: dev@streams.incubator.apache.org Reply-To: dev@streams.incubator.apache.org References: In-Reply-To: Subject: [GitHub] incubator-streams pull request: Streams 164 Content-Type: text/plain Message-Id: <20140916182838.F0E45A1681F@tyr.zones.apache.org> Date: Tue, 16 Sep 2014 18:28:38 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org 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. ---