Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2203#discussion_r160501227
--- Diff:
storm-core/src/jvm/org/apache/storm/nimbus/DefaultTopologyValidator.java ---
@@ -17,15 +17,49 @@
*/
package org.apache.storm.nimbus;
+import org.apache.storm.generated.Bolt;
import org.apache.storm.generated.InvalidTopologyException;
+import org.apache.storm.generated.SpoutSpec;
import org.apache.storm.generated.StormTopology;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.util.Map;
public class DefaultTopologyValidator implements ITopologyValidator {
+ private static final Logger LOG =
LoggerFactory.getLogger(DefaultTopologyValidator.class);
@Override
public void prepare(Map StormConf){
}
@Override
- public void validate(String topologyName, Map topologyConf,
StormTopology topology) throws InvalidTopologyException {
+ public void validate(String topologyName, Map topologyConf,
StormTopology topology) throws InvalidTopologyException {
+ if(topologyName.contains(".")){
+ LOG.warn("Metrics for topology name '{}' will be reported as
'{}'.", topologyName, topologyName.replace('.', '_') );
+ }
+ Map<String, SpoutSpec> spouts = topology.get_spouts();
+ for(String spoutName : spouts.keySet()){
+ if(spoutName.contains(".")){
+ LOG.warn("Metrics for spout name '{}' will be reported as
'{}'.", spoutName, spoutName.replace('.', '_') );
+ }
+ SpoutSpec spoutSpec = spouts.get(spoutName);
+ for(String streamName :
spoutSpec.get_common().get_streams().keySet()){
+ if(streamName.contains(".")){
+ LOG.warn("Metrics for stream name '{}' will be
reported as '{}'.", streamName, streamName.replace('.', '_') );
+ }
+ }
+ }
+
+ Map<String, Bolt> bolts = topology.get_bolts();
+ for(String boltName : bolts.keySet()){
+ if(boltName.contains(".")){
+ LOG.warn("Metrics for bolt name '{}' will be reported as
'{}'.", boltName, boltName.replace('.', '_') );
+ }
+ Bolt bolt = bolts.get(boltName);
+ for(String streamName :
bolt.get_common().get_streams().keySet()){
+ if(streamName.contains(".")){
+ LOG.warn("Metrics for stream name '{}' will be
reported as '{}'.", streamName, streamName.replace('.', '_') );
+ }
+ }
+ }
--- End diff --
This is fine, but kind of useless. The warnings are going to show up in
the number log, so the end user never sees them.
---