public class LoadCompConf extends Object
Configuration for a simulated spout.
Modifier and Type | Class and Description |
---|---|
static class |
LoadCompConf.Builder |
Modifier and Type | Field and Description |
---|---|
double |
cpuLoad |
String |
id |
double |
memoryLoad |
int |
parallelism |
SlowExecutorPattern |
slp |
List<OutputStream> |
streams |
Constructor and Description |
---|
LoadCompConf(String id,
int parallelism,
List<OutputStream> streams,
double cpuLoad,
double memoryLoad,
SlowExecutorPattern slp)
Create a new LoadCompConf with the given values.
|
Modifier and Type | Method and Description |
---|---|
static LoadCompConf |
fromConf(Map<String,Object> conf)
Parse the LoadCompConf from a config Map.
|
double |
getAllEmittedAggregate()
Compute the total amount of all messages emitted in all streams per second.
|
LoadCompConf |
overrideSlowExecutorPattern(SlowExecutorPattern slp)
Override the SlowExecutorPattern with a new one.
|
LoadCompConf |
remap(Map<String,String> remappedComponents,
Map<GlobalStreamId,GlobalStreamId> remappedStreams)
Chenge the name of components and streams according to the parameters passed in.
|
LoadCompConf |
scaleParallel(double v)
Scale the parallelism of this component by v.
|
LoadCompConf |
scaleThroughput(double v)
Scale the throughput of this component.
|
LoadCompConf |
setParallel(int newParallelism)
Set the parallelism of this component, and adjust the throughput so in aggregate it stays the same.
|
Map<String,Object> |
toConf()
Build a config map for this object.
|
public final String id
public final int parallelism
public final List<OutputStream> streams
public final double cpuLoad
public final double memoryLoad
public final SlowExecutorPattern slp
public LoadCompConf(String id, int parallelism, List<OutputStream> streams, double cpuLoad, double memoryLoad, SlowExecutorPattern slp)
Create a new LoadCompConf with the given values.
id
- the id of the component.parallelism
- tha parallelism of the component.streams
- the output streams of the component.public static LoadCompConf fromConf(Map<String,Object> conf)
Parse the LoadCompConf from a config Map.
conf
- the map holding the config for a LoadCompConf.public Map<String,Object> toConf()
Build a config map for this object.
public LoadCompConf remap(Map<String,String> remappedComponents, Map<GlobalStreamId,GlobalStreamId> remappedStreams)
Chenge the name of components and streams according to the parameters passed in.
remappedComponents
- original component name to new component name.remappedStreams
- original stream id to new stream id.public LoadCompConf scaleParallel(double v)
Scale 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.
v
- 1.0 is not change 0.5 is drop the parallelism by half.public LoadCompConf setParallel(int newParallelism)
Set the parallelism of this component, and adjust the throughput so in aggregate it stays the same.
newParallelism
- the new parallelism to set.public LoadCompConf scaleThroughput(double v)
Scale the throughput of this component.
v
- 1.0 is unchanged 0.5 will cut the throughput in half.public LoadCompConf overrideSlowExecutorPattern(SlowExecutorPattern slp)
Override the SlowExecutorPattern with a new one.
slp
- the new pattern or null if you don’t want it to changepublic double getAllEmittedAggregate()
Compute the total amount of all messages emitted in all streams per second.
Copyright © 2022 The Apache Software Foundation. All rights reserved.