Package org.apache.storm.topology
Class BaseConfigurationDeclarer<T extends ComponentConfigurationDeclarer>
java.lang.Object
org.apache.storm.topology.BaseConfigurationDeclarer<T>
- All Implemented Interfaces:
ComponentConfigurationDeclarer<T>
,ResourceDeclarer<T>
- Direct Known Subclasses:
TopologyBuilder.ConfigGetter
public abstract class BaseConfigurationDeclarer<T extends ComponentConfigurationDeclarer>
extends Object
implements ComponentConfigurationDeclarer<T>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddConfiguration
(String config, Object value) Add in a single config.addResource
(String resourceName, Number resourceValue) Add generic resource for this component.addResources
(Map<String, Double> resources) Add generic resources for this component.setCPULoad
(Number amount) Set the amount of CPU load for this component.setDebug
(boolean debug) Turn on/off debug for this component.setMaxSpoutPending
(Number val) Set the max spout pending config for this component.Set the max task parallelism for this component.setMemoryLoad
(Number onHeap) Set the amount of on heap memory for this component.setMemoryLoad
(Number onHeap, Number offHeap) Set the amount of memory for this component on and off heap.setNumTasks
(Number val) Set the number of tasks for this component.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.storm.topology.ComponentConfigurationDeclarer
addConfigurations, getComponentConfiguration
Methods inherited from interface org.apache.storm.topology.ResourceDeclarer
addSharedMemory
-
Constructor Details
-
BaseConfigurationDeclarer
public BaseConfigurationDeclarer()
-
-
Method Details
-
addConfiguration
Description copied from interface:ComponentConfigurationDeclarer
Add in a single config.- Specified by:
addConfiguration
in interfaceComponentConfigurationDeclarer<T extends ComponentConfigurationDeclarer>
- Parameters:
config
- the key for the configvalue
- the value of the config- Returns:
- this for chaining.
-
setDebug
Description copied from interface:ComponentConfigurationDeclarer
Turn on/off debug for this component.- Specified by:
setDebug
in interfaceComponentConfigurationDeclarer<T extends ComponentConfigurationDeclarer>
- Parameters:
debug
- true for debug on false for debug off- Returns:
- this for chaining
-
setMaxTaskParallelism
Description copied from interface:ComponentConfigurationDeclarer
Set the max task parallelism for this component.- Specified by:
setMaxTaskParallelism
in interfaceComponentConfigurationDeclarer<T extends ComponentConfigurationDeclarer>
- Parameters:
val
- the maximum parallelism- Returns:
- this for chaining
-
setMaxSpoutPending
Description copied from interface:ComponentConfigurationDeclarer
Set the max spout pending config for this component.- Specified by:
setMaxSpoutPending
in interfaceComponentConfigurationDeclarer<T extends ComponentConfigurationDeclarer>
- Parameters:
val
- the value of max spout pending.- Returns:
- this for chaining
-
setNumTasks
Description copied from interface:ComponentConfigurationDeclarer
Set the number of tasks for this component.- Specified by:
setNumTasks
in interfaceComponentConfigurationDeclarer<T extends ComponentConfigurationDeclarer>
- Parameters:
val
- the number of tasks- Returns:
- this for chaining.
-
setMemoryLoad
Description copied from interface:ResourceDeclarer
Set the amount of on heap memory for this component.- Specified by:
setMemoryLoad
in interfaceResourceDeclarer<T extends ComponentConfigurationDeclarer>
- Parameters:
onHeap
- the amount of on heap memory- Returns:
- this for chaining
-
setMemoryLoad
Description copied from interface:ResourceDeclarer
Set the amount of memory for this component on and off heap.- Specified by:
setMemoryLoad
in interfaceResourceDeclarer<T extends ComponentConfigurationDeclarer>
- Parameters:
onHeap
- the amount of on heap memoryoffHeap
- the amount of off heap memory- Returns:
- this for chaining
-
setCPULoad
Description copied from interface:ResourceDeclarer
Set the amount of CPU load for this component.- Specified by:
setCPULoad
in interfaceResourceDeclarer<T extends ComponentConfigurationDeclarer>
- Parameters:
amount
- the amount of CPU- Returns:
- this for chaining
-
addResource
Description copied from interface:ComponentConfigurationDeclarer
Add generic resource for this component.- Specified by:
addResource
in interfaceComponentConfigurationDeclarer<T extends ComponentConfigurationDeclarer>
-
addResources
Add generic resources for this component.- Specified by:
addResources
in interfaceComponentConfigurationDeclarer<T extends ComponentConfigurationDeclarer>
-