You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@streams.apache.org by steveblackmon <gi...@git.apache.org> on 2014/09/13 01:23:20 UTC
[GitHub] incubator-streams pull request: Streams 164
GitHub user steveblackmon opened a pull request:
https://github.com/apache/incubator-streams/pull/83
Streams 164
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/incubator-streams STREAMS-164
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-streams/pull/83.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #83
----
commit df00e4a06376bacda755618595922cd3382d121a
Author: Steve Blackmon <sb...@w2odigital.com>
Date: 2014-09-11T16:32:53Z
writer should work without metadata
commit 64c608f10d91435b5b127726d6e670daaa0cb6be
Author: Steve Blackmon <sb...@w2odigital.com>
Date: 2014-09-11T17:07:33Z
updater should work without metadata
general cleanup of configurator
commit 63e2d428aebc0b6619e6b4167ac8ad8f33709c75
Author: Steve Blackmon <sb...@w2odigital.com>
Date: 2014-09-11T17:36:00Z
changed how index, type, id get set to allow for absent metadata
commit 9c98a450115f7e136d002c2df311aeebc3f860fe
Author: sblackmon <sb...@apache.org>
Date: 2014-09-12T21:01:39Z
more consistent logging / exception handling
----
---
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.
---
[GitHub] incubator-streams pull request: Streams 164
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/incubator-streams/pull/83
---
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.
---
[GitHub] incubator-streams pull request: Streams 164
Posted by robdouglas <gi...@git.apache.org>.
Github user robdouglas commented on a diff in the pull request:
https://github.com/apache/incubator-streams/pull/83#discussion_r17621772
--- 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 --
I'm talking about lines 45 - 70. Those appear to be the same throughout
---
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.
---
[GitHub] incubator-streams pull request: Streams 164
Posted by robdouglas <gi...@git.apache.org>.
Github user robdouglas commented on the pull request:
https://github.com/apache/incubator-streams/pull/83#issuecomment-55796705
:+1:
---
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.
---
[GitHub] incubator-streams pull request: Streams 164
Posted by steveblackmon <gi...@git.apache.org>.
Github user steveblackmon commented on a diff in the pull request:
https://github.com/apache/incubator-streams/pull/83#discussion_r17621665
--- 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 --
yes, but it would take more code to abstract lines 45 and 46 across 3 similar classes than to leave as it.
---
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.
---
[GitHub] incubator-streams pull request: Streams 164
Posted by robdouglas <gi...@git.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.
---
[GitHub] incubator-streams pull request: Streams 164
Posted by steveblackmon <gi...@git.apache.org>.
Github user steveblackmon commented on a diff in the pull request:
https://github.com/apache/incubator-streams/pull/83#discussion_r17623400
--- 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 --
That's fair. I pushed an update to the PR to address this.
---
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.
---