apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davidyan74 <...@git.apache.org>
Subject [GitHub] incubator-apex-core pull request: APEXCORE-60 Iteration support in...
Date Tue, 05 Jan 2016 21:03:57 GMT
Github user davidyan74 commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-core/pull/185#discussion_r48895909
  
    --- Diff: engine/src/main/java/com/datatorrent/stram/engine/GenericNode.java ---
    @@ -364,29 +413,49 @@ else if (!doCheckpoint) {
                       if (tracker.ports[trackerIndex] == null) {
                         tracker.ports[trackerIndex++] = activePort;
                         break;
    -                  }
    -                  else if (tracker.ports[trackerIndex] == activePort) {
    +                  } else if (tracker.ports[trackerIndex] == activePort) {
                         break;
                       }
     
                       trackerIndex++;
                     }
     
    -                if (trackerIndex == totalQueues) {
    -                  trackerIterator = resetTupleTracker.iterator();
    +                if (trackerIndex == regularQueues) {
    +                  Iterator<TupleTracker> trackerIterator = resetTupleTracker.iterator();
                       while (trackerIterator.hasNext()) {
                         if (trackerIterator.next().tuple.getBaseSeconds() <= baseSeconds)
{
                           trackerIterator.remove();
                         }
                       }
    -                  for (int s = sinks.length; s-- > 0; ) {
    -                    sinks[s].put(t);
    +                  if (!delay) {
    +                    for (int s = sinks.length; s-- > 0; ) {
    +                      sinks[s].put(t);
    +                    }
    +                    controlTupleCount++;
                       }
    -                  controlTupleCount++;
    -
    -                  assert (activeQueues.isEmpty());
    -                  activeQueues.addAll(inputs.values());
    +                  if (!activeQueues.isEmpty()) {
    +                    // make sure they are all queues from DelayOperator
    +                    for (Map.Entry<String, SweepableReservoir> entry : activeQueues)
{
    +                      if (!isInputPortConnectedToDelayOperator(entry.getKey())) {
    +                        assert (false);
    +                      }
    +                    }
    +                    activeQueues.clear();
    +                  }
    +                  activeQueues.addAll(inputs.entrySet());
                       expectingBeginWindow = activeQueues.size();
    +
    +                  if (firstWindowId == -1) {
    +                    if (delay) {
    +                      for (int s = sinks.length; s-- > 0; ) {
    +                        sinks[s].put(t);
    +                      }
    +                      // if it's a DelayOperator and this is the first RESET_WINDOW (start)
or END_STREAM
    --- End diff --
    
    fixed


---
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.
---

Mime
View raw message