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 7932F11450 for ; Mon, 30 Jun 2014 16:18:42 +0000 (UTC) Received: (qmail 61919 invoked by uid 500); 30 Jun 2014 16:18:42 -0000 Delivered-To: apmail-streams-dev-archive@streams.apache.org Received: (qmail 61878 invoked by uid 500); 30 Jun 2014 16:18:42 -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 61863 invoked by uid 99); 30 Jun 2014 16:18:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jun 2014 16:18:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_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; Mon, 30 Jun 2014 16:18:40 +0000 Received: (qmail 60977 invoked by uid 99); 30 Jun 2014 16:18:20 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jun 2014 16:18:20 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 4FAB692F2F0; Mon, 30 Jun 2014 16:18:20 +0000 (UTC) From: mfranklin To: dev@streams.incubator.apache.org Reply-To: dev@streams.incubator.apache.org References: In-Reply-To: Subject: [GitHub] incubator-streams pull request: Streams 105 Content-Type: text/plain Message-Id: <20140630161820.4FAB692F2F0@tyr.zones.apache.org> Date: Mon, 30 Jun 2014 16:18:20 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org Github user mfranklin commented on a diff in the pull request: https://github.com/apache/incubator-streams/pull/47#discussion_r14359066 --- Diff: streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/serializer/DatasiftTweetActivitySerializer.java --- @@ -215,18 +217,22 @@ public void addTwitterExtensions(Activity activity, Twitter twitter, Interaction } if(interaction.getAdditionalProperties() != null) { - Object mentionsObject = interaction.getAdditionalProperties().get("mentions"); - if(mentionsObject != null ) { - if(mentionsObject instanceof List) { - List mentions = (List) mentionsObject; - List> userMentions = Lists.newLinkedList(); - for(Object mention : mentions) { - Map actor = Maps.newHashMap(); - actor.put("displayName", mention); - userMentions.add(actor); - } - extensions.put("user_mentions", userMentions); + ArrayList mentions = (ArrayList) interaction.getAdditionalProperties().get("mentions"); + ArrayList mentionIds = (ArrayList) interaction.getAdditionalProperties().get("mention_ids"); + ArrayList userMentions = new ArrayList(); + + if(mentions != null && mentionIds != null && (mentionIds.size() == mentions.size()) && !mentions.isEmpty() && !mentionIds.isEmpty()) { --- End diff -- Since there is no 100% completely accurate way to assert the IDs match the handles, then I would say create a different object for each and let a downstream processor merge them by checking twitter API. Either that or completely disregard one or the other. You might want to discuss this on the list to get other opinions. --- 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. ---