[ 
https://issues.apache.org/jira/browse/APEXCORE-413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15236580#comment-15236580
 ] 

ASF GitHub Bot commented on APEXCORE-413:
-----------------------------------------

Github user vrozov commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-core/pull/301#discussion_r59320592
  
    --- Diff: engine/src/main/java/com/datatorrent/stram/stream/OiOStream.java 
---
    @@ -29,11 +29,12 @@
      *
      * @since 0.3.5
      */
    -public class OiOStream implements Stream, SweepableReservoir
    --- End diff --
    
    It is necessary to maintain two different counts - one for Sink and one for 
SweepableReservoir as they are reset separately. In case, OioStream implements 
both Stream and SweepableReservoir, it will not be possible to distinguish 
which count should be reset to 0, so either `Sink.getCount()` or 
`SweepableReservoir.getCount()` would return a wrong result.


> Collision between Sink.getCount() and SweepableReservoir.getCount()
> -------------------------------------------------------------------
>
>                 Key: APEXCORE-413
>                 URL: https://issues.apache.org/jira/browse/APEXCORE-413
>             Project: Apache Apex Core
>          Issue Type: Bug
>    Affects Versions: 3.2.0, 3.3.0
>            Reporter: Vlad Rozov
>            Assignee: Vlad Rozov
>             Fix For: 3.4.0
>
>
> SweepableReservoir.getCount() and Sink.getCount() are two distinct counts as 
> SweepableReservoir.getCount() returns number of tuples consumed/poll from the 
> reservoir by an operator since the last reset, while Sink.getCount() returns 
> number of tuples pushed into the sink since the last reset. For InlineStream 
> that implements both interfaces, it causes a conflict as a count of tuples 
> pushed into InlineStream is not necessarily equal to a count of tuples poll 
> from it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to