Package org.apache.storm.loadgen
Class TopologyLoadConf
java.lang.Object
org.apache.storm.loadgen.TopologyLoadConf
Configuration for a simulated topology.
-
Field Summary
Modifier and TypeFieldDescriptionfinal List<LoadCompConf>
final String
final List<LoadCompConf>
final List<InputStream>
-
Constructor Summary
ConstructorDescriptionTopologyLoadConf
(String name, Map<String, Object> topoConf, List<LoadCompConf> spouts, List<LoadCompConf> bolts, List<InputStream> streams) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionCreate a new version of this topology with identifiable information removed.static TopologyLoadConf
Parse the TopologyLoadConf from a file in YAML format.static TopologyLoadConf
Parse the TopologyLoadConf from a config map.double
Get the messages emitted per second in aggregate across all streams in the topology.double
Get the messages emitted per second in aggregate for all of the spouts in the topology.double
Try and guess at the actual number of messages emitted per second by a trident topology, not the number of batches.boolean
Try 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.void
Write this out to a file in YAML format.
-
Field Details
-
name
-
topoConf
-
spouts
-
bolts
-
streams
-
-
Constructor Details
-
TopologyLoadConf
public 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 topologyspouts
- the spouts for the topologybolts
- the bolts for the topologystreams
- the streams for the topology
-
-
Method Details
-
fromConf
Parse 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.
-
fromConf
Parse the TopologyLoadConf from a config map.- Parameters:
conf
- the config with the TopologyLoadConf in it- Returns:
- the parsed instance.
-
writeTo
Write 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.
-
toYamlString
Convert this into a YAML String.- Returns:
- this as a YAML String.
-
toConf
Covert this into a Map config.- Returns:
- this as a Map config.
-
withName
-
scaleParallel
Scale 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.
-
scaleThroughput
Scale 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.
-
overrideSlowExecs
Override 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.
-
anonymize
Create a new version of this topology with identifiable information removed.- Returns:
- the anonymized version of the TopologyLoadConf.
-
looksLikeTrident
public 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.
-
getAllEmittedAggregate
public double getAllEmittedAggregate()Get the messages emitted per second in aggregate across all streams in the topology.- Returns:
- messages per second.
-
getSpoutEmittedAggregate
public double getSpoutEmittedAggregate()Get the messages emitted per second in aggregate for all of the spouts in the topology.- Returns:
- messages per second.
-
getTridentEstimatedEmittedAggregate
public 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
-