Github user tweise commented on a diff in the pull request:
https://github.com/apache/incubator-apex-core/pull/148#discussion_r47588531
--- Diff:
engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java ---
@@ -2246,6 +2306,50 @@ public LogicalOperatorInfo
getLogicalOperatorInfo(String operatorName)
return fillLogicalOperatorInfo(operatorMeta);
}
+ public LogicalModuleInfo getLogicalModuleInfo(ModuleMeta module, boolean
flatten)
+ {
+ LogicalModuleInfo lmi = new LogicalModuleInfo();
+ lmi.name = module.getName();
+ lmi.className = module.getModule().getClass().getName();
+ if (flatten) {
+ for (OperatorMeta operatorMeta : module.getDag().getAllOperators()) {
+ if (operatorMeta.getModuleName() == null) {
+ String fullPath = module.getFullName() +
LogicalPlan.MODULE_NAMESPACE_SEPARATOR + operatorMeta.getName();
+
lmi.operators.add(fillLogicalOperatorInfo(getLogicalPlan().getOperatorMeta(fullPath)));
+ }
+ }
+ for (StreamMeta streamMeta : module.getDag().getAllStreams()) {
--- End diff --
Hmm. I tried the modification below which looks straightforward but there
does not seem to be a unit test?
```
diff --git
a/engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java
b/engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java
index 9e5ffc6..c207dd1 100644
---
a/engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java
+++
b/engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java
@@ -2311,18 +2311,26 @@ public class StreamingContainerManager implements
PlanContext
LogicalModuleInfo lmi = new LogicalModuleInfo();
lmi.name = module.getName();
lmi.className = module.getModule().getClass().getName();
+ LinkedHashSet<StreamMeta> topLevelStreams = new LinkedHashSet<>();
if (flatten) {
for (OperatorMeta operatorMeta : module.getDag().getAllOperators()) {
if (operatorMeta.getModuleName() == null) {
String fullPath = module.getFullName() +
LogicalPlan.MODULE_NAMESPACE_SEPARATOR + operatorMeta.getName();
-
lmi.operators.add(fillLogicalOperatorInfo(getLogicalPlan().getOperatorMeta(fullPath)));
- }
- }
- for (StreamMeta streamMeta : module.getDag().getAllStreams()) {
- if (streamMeta.getModuleName() == null) {
- String fullPath = module.getFullName() +
LogicalPlan.MODULE_NAMESPACE_SEPARATOR + streamMeta.getName();
-
lmi.streams.add(fillLogicalStreamInfo(getLogicalPlan().getStream(fullPath)));
- }
+//
lmi.operators.add(fillLogicalOperatorInfo(getLogicalPlan().getOperatorMeta(fullPath)));
+ OperatorMeta topLevelOper =
getLogicalPlan().getOperatorMeta(fullPath);
+ topLevelStreams.addAll(topLevelOper.getInputStreams().values());
+ topLevelStreams.addAll(topLevelOper.getOutputStreams().values());
+ lmi.operators.add(fillLogicalOperatorInfo(topLevelOper));
+ }
+ }
+// for (StreamMeta streamMeta : module.getDag().getAllStreams()) {
+// if (streamMeta.getModuleName() == null) {
+// String fullPath = module.getFullName() +
LogicalPlan.MODULE_NAMESPACE_SEPARATOR + streamMeta.getName();
+//
lmi.streams.add(fillLogicalStreamInfo(getLogicalPlan().getStream(fullPath)));
+// }
+// }
+ for (StreamMeta streamMeta : topLevelStreams) {
+ lmi.streams.add(fillLogicalStreamInfo(streamMeta));
}
for(ModuleMeta mMeta : module.getDag().getAllModules()) {
lmi.modules.add(getLogicalModuleInfo(mMeta, true));
@@ -2348,8 +2356,8 @@ public class StreamingContainerManager implements
PlanContext
}
return null;
}
```
---
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.
---