Github user gauravgopi123 commented on a diff in the pull request:
https://github.com/apache/incubator-apex-core/pull/185#discussion_r47818666
--- Diff:
engine/src/main/java/com/datatorrent/stram/plan/logical/LogicalPlan.java ---
@@ -1607,12 +1636,43 @@ else if (stack.contains(successor)) {
}
// strongly connected (cycle) if more than one node in stack
if (connectedIds.size() > 1) {
- LOG.debug("detected cycle from node {}: {}", om.name,
connectedIds);
+ LOG.error("detected cycle from node {}: {}", om.name,
connectedIds);
cycles.add(connectedIds);
}
}
}
+ public void findInvalidDelays(OperatorMeta om, List<List<String>>
invalidDelays)
+ {
+ stack.push(om);
+
+ // depth first successors traversal
+ boolean isDelayOperator = om.getOperator() instanceof
Operator.DelayOperator;
+ if (isDelayOperator) {
+ if (om.getValue(OperatorContext.APPLICATION_WINDOW_COUNT) != 1) {
+ LOG.error("detected DelayOperator having APPLICATION_WINDOW_COUNT
not equal to 1");
+ invalidDelays.add(Collections.singletonList(om.getName()));
+ }
+ }
+
+ for (StreamMeta downStream: om.outputStreams.values()) {
+ for (InputPortMeta sink : downStream.sinks) {
+ OperatorMeta successor = sink.getOperatorWrapper();
+ if (isDelayOperator) {
+ // Check whether all downstream operators are already visited in
the path
+ if (successor != null && !stack.contains(successor)) {
--- End diff --
I have a dag A->D where A is an operator and D is delay Operator. This is
valid dag. If findInvalidDelays is called with D's meta then
!stack.contains(successor) will fail.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---