nickwallen commented on a change in pull request #1346: METRON-2016: Parser
aggregate groups should be persisted and available through REST
URL: https://github.com/apache/metron/pull/1346#discussion_r262232485
##########
File path:
metron-interface/metron-rest/src/main/java/org/apache/metron/rest/service/impl/StormStatusServiceImpl.java
##########
@@ -145,4 +136,35 @@ protected String getStormUiProperty() {
}
return baseValue;
}
+
+ /**
+ * Retrieves the Storm topology id from the given topology name. If a
topology name is detected to be an aggregate
+ * parser topology, the SensorParserGroups are checked for a match.
+ * @param name Topology or SensorParserGroup name
+ * @return Topology id
+ */
+ protected String getTopologyId(String name) {
+ String id = null;
+ for (TopologyStatus topology : getTopologySummary().getTopologies()) {
+ String topologyName = topology.getName();
+
+ // check sensor group
+ if (topologyName.contains(ParserTopologyCLI.STORM_JOB_SEPARATOR)) {
+ Set<String> sensors = new
HashSet<>(Arrays.asList(topologyName.split(ParserTopologyCLI.STORM_JOB_SEPARATOR)));
Review comment:
Is this related to the code that is in
`StormAdminServiceImpl.startParserTopology` where it creates the topology name
from the sensor types? This is just the inverse, right?
It seems like all logic that maps sensors to a topology name and vice-versa,
could exist in a single class that is reused. This would let us easily throw a
bunch of unit tests around it and ensure we catch any weird corner cases.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services