Package org.apache.storm.loadgen
Class LoadCompConf
java.lang.Object
org.apache.storm.loadgen.LoadCompConf
Configuration for a simulated spout.
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionfinal doublefinal Stringfinal doublefinal intfinal SlowExecutorPatternfinal List<OutputStream>
- 
Constructor SummaryConstructorsConstructorDescriptionLoadCompConf(String id, int parallelism, List<OutputStream> streams, double cpuLoad, double memoryLoad, SlowExecutorPattern slp) Create a new LoadCompConf with the given values.
- 
Method SummaryModifier and TypeMethodDescriptionstatic LoadCompConfParse the LoadCompConf from a config Map.doubleCompute the total amount of all messages emitted in all streams per second.Override the SlowExecutorPattern with a new one.remap(Map<String, String> remappedComponents, Map<GlobalStreamId, GlobalStreamId> remappedStreams) Chenge the name of components and streams according to the parameters passed in.scaleParallel(double v) Scale the parallelism of this component by v.scaleThroughput(double v) Scale the throughput of this component.setParallel(int newParallelism) Set the parallelism of this component, and adjust the throughput so in aggregate it stays the same.toConf()Build a config map for this object.
- 
Field Details- 
id
- 
parallelismpublic final int parallelism
- 
streams
- 
cpuLoadpublic final double cpuLoad
- 
memoryLoadpublic final double memoryLoad
- 
slp
 
- 
- 
Constructor Details- 
LoadCompConfpublic LoadCompConf(String id, int parallelism, List<OutputStream> streams, double cpuLoad, double memoryLoad, SlowExecutorPattern slp) Create a new LoadCompConf with the given values.- Parameters:
- id- the id of the component.
- parallelism- tha parallelism of the component.
- streams- the output streams of the component.
 
 
- 
- 
Method Details- 
fromConfParse the LoadCompConf from a config Map.- Parameters:
- conf- the map holding the config for a LoadCompConf.
- Returns:
- the parsed object.
 
- 
toConfBuild a config map for this object.- Returns:
- the config map.
 
- 
remappublic LoadCompConf remap(Map<String, String> remappedComponents, Map<GlobalStreamId, GlobalStreamId> remappedStreams) Chenge the name of components and streams according to the parameters passed in.- Parameters:
- remappedComponents- original component name to new component name.
- remappedStreams- original stream id to new stream id.
- Returns:
- a copy of this with the values remapped.
 
- 
scaleParallelScale the parallelism of this component by v. The aggregate throughput will be the same. The parallelism will be rounded up to the next largest whole number. Parallelism will always be at least 1.- Parameters:
- v- 1.0 is not change 0.5 is drop the parallelism by half.
- Returns:
- a copy of this with the parallelism adjusted.
 
- 
setParallelSet the parallelism of this component, and adjust the throughput so in aggregate it stays the same.- Parameters:
- newParallelism- the new parallelism to set.
- Returns:
- a copy of this with the adjustments made.
 
- 
scaleThroughputScale the throughput of this component.- Parameters:
- v- 1.0 is unchanged 0.5 will cut the throughput in half.
- Returns:
- a copy of this with the adjustments made.
 
- 
overrideSlowExecutorPatternOverride the SlowExecutorPattern with a new one.- Parameters:
- slp- the new pattern or null if you don't want it to change
- Returns:
- a copy of this with the adjustments made.
 
- 
getAllEmittedAggregatepublic double getAllEmittedAggregate()Compute the total amount of all messages emitted in all streams per second.- Returns:
- the sum of all messages emitted per second.
 
 
-