public class TopologyLoadConf extends Object
Configuration for a simulated topology.
Modifier and Type | Field and Description |
---|---|
List<LoadCompConf> |
bolts |
String |
name |
List<LoadCompConf> |
spouts |
List<InputStream> |
streams |
Map<String,Object> |
topoConf |
Constructor and Description |
---|
TopologyLoadConf(String name,
Map<String,Object> topoConf,
List<LoadCompConf> spouts,
List<LoadCompConf> bolts,
List<InputStream> streams)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
TopologyLoadConf |
anonymize()
Create a new version of this topology with identifiable information removed.
|
static TopologyLoadConf |
fromConf(File file)
Parse the TopologyLoadConf from a file in YAML format.
|
static TopologyLoadConf |
fromConf(Map<String,Object> conf)
Parse the TopologyLoadConf from a config map.
|
double |
getAllEmittedAggregate()
Get the messages emitted per second in aggregate across all streams in the topology.
|
double |
getSpoutEmittedAggregate()
Get the messages emitted per second in aggregate for all of the spouts in the topology.
|
double |
getTridentEstimatedEmittedAggregate()
Try and guess at the actual number of messages emitted per second by a trident topology, not the number of batches.
|
boolean |
looksLikeTrident()
Try to see if this looks like a trident topology.
|
TopologyLoadConf |
overrideSlowExecs(Map<String,SlowExecutorPattern> topoSpecific)
Override the SlowExecutorPattern for given components.
|
TopologyLoadConf |
replaceShuffleWithLocalOrShuffle() |
TopologyLoadConf |
scaleParallel(double v,
Map<String,Double> topoSpecific)
Scale all of the components in the topology by a percentage (but keep the throughput the same).
|
TopologyLoadConf |
scaleThroughput(double v,
Map<String,Double> topoSpecific)
Scale the throughput of the entire topology by a percentage.
|
Map<String,Object> |
toConf()
Covert this into a Map config.
|
String |
toYamlString()
Convert this into a YAML String.
|
TopologyLoadConf |
withName(String baseName) |
void |
writeTo(File file)
Write this out to a file in YAML format.
|
public final String name
public final List<LoadCompConf> spouts
public final List<LoadCompConf> bolts
public final List<InputStream> streams
public TopologyLoadConf(String name, Map<String,Object> topoConf, List<LoadCompConf> spouts, List<LoadCompConf> bolts, List<InputStream> streams)
Constructor.
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 topologypublic static TopologyLoadConf fromConf(File file) throws IOException
Parse the TopologyLoadConf from a file in YAML format.
file
- the file to read fromIOException
- if there is an issue reading the file.public static TopologyLoadConf fromConf(Map<String,Object> conf)
Parse the TopologyLoadConf from a config map.
conf
- the config with the TopologyLoadConf in itpublic void writeTo(File file) throws IOException
Write this out to a file in YAML format.
file
- the file to write to.IOException
- if there is an error writing to the file.public String toYamlString()
Convert this into a YAML String.
public Map<String,Object> toConf()
Covert this into a Map config.
public TopologyLoadConf withName(String baseName)
public TopologyLoadConf scaleParallel(double v, Map<String,Double> topoSpecific)
Scale all of the components in the topology by a percentage (but keep the throughput the same).
v
- the amount to scale them by. 1.0 is nothing, 0.5 cuts them in half, 2.0 doubles them.public TopologyLoadConf scaleThroughput(double v, Map<String,Double> topoSpecific)
Scale the throughput of the entire topology by a percentage.
v
- the amount to scale it by 1.0 is nothing 0.5 cuts it in half and 2.0 doubles it.public TopologyLoadConf overrideSlowExecs(Map<String,SlowExecutorPattern> topoSpecific)
Override the SlowExecutorPattern for given components.
topoSpecific
- what we are going to use to override.public TopologyLoadConf anonymize()
Create a new version of this topology with identifiable information removed.
public boolean looksLikeTrident()
Try to see if this looks like a trident topology. NOTE: this will not work for anonymized configs
public double getAllEmittedAggregate()
Get the messages emitted per second in aggregate across all streams in the topology.
public double getSpoutEmittedAggregate()
Get the messages emitted per second in aggregate for all of the spouts in the topology.
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.
public TopologyLoadConf replaceShuffleWithLocalOrShuffle()
Copyright © 2022 The Apache Software Foundation. All rights reserved.