Package org.apache.storm.loadgen
Class TopologyLoadConf
java.lang.Object
org.apache.storm.loadgen.TopologyLoadConf
Configuration for a simulated topology.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionfinal List<LoadCompConf>final Stringfinal List<LoadCompConf>final List<InputStream>
- 
Constructor SummaryConstructorsConstructorDescriptionTopologyLoadConf(String name, Map<String, Object> topoConf, List<LoadCompConf> spouts, List<LoadCompConf> bolts, List<InputStream> streams) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionCreate a new version of this topology with identifiable information removed.static TopologyLoadConfParse the TopologyLoadConf from a file in YAML format.static TopologyLoadConfParse the TopologyLoadConf from a config map.doubleGet the messages emitted per second in aggregate across all streams in the topology.doubleGet the messages emitted per second in aggregate for all of the spouts in the topology.doubleTry and guess at the actual number of messages emitted per second by a trident topology, not the number of batches.booleanTry to see if this looks like a trident topology.overrideSlowExecs(Map<String, SlowExecutorPattern> topoSpecific) Override the SlowExecutorPattern for given components.scaleParallel(double v, Map<String, Double> topoSpecific) Scale all of the components in the topology by a percentage (but keep the throughput the same).scaleThroughput(double v, Map<String, Double> topoSpecific) Scale the throughput of the entire topology by a percentage.toConf()Covert this into a Map config.Convert this into a YAML String.voidWrite this out to a file in YAML format.
- 
Field Details- 
name
- 
topoConf
- 
spouts
- 
bolts
- 
streams
 
- 
- 
Constructor Details- 
TopologyLoadConfpublic TopologyLoadConf(String name, Map<String, Object> topoConf, List<LoadCompConf> spouts, List<LoadCompConf> bolts, List<InputStream> streams) Constructor.- Parameters:
- name- the name of the topology.
- topoConf- the config for the topology
- spouts- the spouts for the topology
- bolts- the bolts for the topology
- streams- the streams for the topology
 
 
- 
- 
Method Details- 
fromConfParse the TopologyLoadConf from a file in YAML format.- Parameters:
- file- the file to read from
- Returns:
- the parsed conf
- Throws:
- IOException- if there is an issue reading the file.
 
- 
fromConfParse the TopologyLoadConf from a config map.- Parameters:
- conf- the config with the TopologyLoadConf in it
- Returns:
- the parsed instance.
 
- 
writeToWrite this out to a file in YAML format.- Parameters:
- file- the file to write to.
- Throws:
- IOException- if there is an error writing to the file.
 
- 
toYamlStringConvert this into a YAML String.- Returns:
- this as a YAML String.
 
- 
toConfCovert this into a Map config.- Returns:
- this as a Map config.
 
- 
withName
- 
scaleParallelScale all of the components in the topology by a percentage (but keep the throughput the same).- Parameters:
- v- the amount to scale them by. 1.0 is nothing, 0.5 cuts them in half, 2.0 doubles them.
- Returns:
- a copy of this with the needed adjustments made.
 
- 
scaleThroughputScale the throughput of the entire topology by a percentage.- Parameters:
- v- the amount to scale it by 1.0 is nothing 0.5 cuts it in half and 2.0 doubles it.
- Returns:
- a copy of this with the needed adjustments made.
 
- 
overrideSlowExecsOverride the SlowExecutorPattern for given components.- Parameters:
- topoSpecific- what we are going to use to override.
- Returns:
- a copy of this with the needed adjustments made.
 
- 
anonymizeCreate a new version of this topology with identifiable information removed.- Returns:
- the anonymized version of the TopologyLoadConf.
 
- 
looksLikeTridentpublic boolean looksLikeTrident()Try to see if this looks like a trident topology. NOTE: this will not work for anonymized configs- Returns:
- true if it does else false.
 
- 
getAllEmittedAggregatepublic double getAllEmittedAggregate()Get the messages emitted per second in aggregate across all streams in the topology.- Returns:
- messages per second.
 
- 
getSpoutEmittedAggregatepublic double getSpoutEmittedAggregate()Get the messages emitted per second in aggregate for all of the spouts in the topology.- Returns:
- messages per second.
 
- 
getTridentEstimatedEmittedAggregatepublic double getTridentEstimatedEmittedAggregate()Try and guess at the actual number of messages emitted per second by a trident topology, not the number of batches. This does not work on an anonymized conf.- Returns:
- messages per second or 0 if this does not look like a trident topology.
 
- 
replaceShuffleWithLocalOrShuffle
 
-