You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by "Jagadish (JIRA)" <ji...@apache.org> on 2017/04/10 18:31:41 UTC

[jira] [Updated] (SAMZA-1202) Multiple calls to `graph.getInputStream()` with the same streamId results in non-deterministic behavior

     [ https://issues.apache.org/jira/browse/SAMZA-1202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jagadish updated SAMZA-1202:
----------------------------
    Description: 
Consider the following code-snippet that invokes graph.getInputStream multiple times with the same streamId (but with different Message Builders).

{code}
    BiFunction<String, String, String> msgBuilder1 = (k, v) -> v;
    BiFunction<String, String, Integer> msgBuilder2 = (k, v) -> new Integer(v);

   graph.getInputStream("page-views", msgBuilder2);
    MessageStream<String> pageViews1 = graph.getInputStream("page-views", msgBuilder1);
   pageViews1.map(..)
                      .filter(..)
                      .window(..)
                      .sink(..)
{code}

TL;DR:

The above snippet results in non-deterministic behavior (Messages may not even be passed in to the operator chain.) due to iteration ordering in Java hashmap. 





> Multiple calls to `graph.getInputStream()` with the same streamId results in non-deterministic behavior
> -------------------------------------------------------------------------------------------------------
>
>                 Key: SAMZA-1202
>                 URL: https://issues.apache.org/jira/browse/SAMZA-1202
>             Project: Samza
>          Issue Type: Bug
>            Reporter: Jagadish
>
> Consider the following code-snippet that invokes graph.getInputStream multiple times with the same streamId (but with different Message Builders).
> {code}
>     BiFunction<String, String, String> msgBuilder1 = (k, v) -> v;
>     BiFunction<String, String, Integer> msgBuilder2 = (k, v) -> new Integer(v);
>    graph.getInputStream("page-views", msgBuilder2);
>     MessageStream<String> pageViews1 = graph.getInputStream("page-views", msgBuilder1);
>    pageViews1.map(..)
>                       .filter(..)
>                       .window(..)
>                       .sink(..)
> {code}
> TL;DR:
> The above snippet results in non-deterministic behavior (Messages may not even be passed in to the operator chain.) due to iteration ordering in Java hashmap. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)