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
Constructors Constructor Description BaseConfigurationDeclarer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TaddConfiguration(String config, Object value)Add in a single config.TaddResource(String resourceName, Number resourceValue)Add generic resource for this component.TaddResources(Map<String,Double> resources)Add generic resources for this component.TsetCPULoad(Number amount)Set the amount of CPU load for this component.TsetDebug(boolean debug)Turn on/off debug for this component.TsetMaxSpoutPending(Number val)Set the max spout pending config for this component.TsetMaxTaskParallelism(Number val)Set the max task parallelism for this component.TsetMemoryLoad(Number onHeap)Set the amount of on heap memory for this component.TsetMemoryLoad(Number onHeap, Number offHeap)Set the amount of memory for this component on and off heap.TsetNumTasks(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
-
-
-
-
Method Detail
-
addConfiguration
public T addConfiguration(String config, Object value)
Description copied from interface:ComponentConfigurationDeclarerAdd in a single config.- Specified by:
addConfigurationin interfaceComponentConfigurationDeclarer<T extends ComponentConfigurationDeclarer>- Parameters:
config- the key for the configvalue- the value of the config- Returns:
- this for chaining.
-
setDebug
public T setDebug(boolean debug)
Description copied from interface:ComponentConfigurationDeclarerTurn on/off debug for this component.- Specified by:
setDebugin interfaceComponentConfigurationDeclarer<T extends ComponentConfigurationDeclarer>- Parameters:
debug- true for debug on false for debug off- Returns:
- this for chaining
-
setMaxTaskParallelism
public T setMaxTaskParallelism(Number val)
Description copied from interface:ComponentConfigurationDeclarerSet the max task parallelism for this component.- Specified by:
setMaxTaskParallelismin interfaceComponentConfigurationDeclarer<T extends ComponentConfigurationDeclarer>- Parameters:
val- the maximum parallelism- Returns:
- this for chaining
-
setMaxSpoutPending
public T setMaxSpoutPending(Number val)
Description copied from interface:ComponentConfigurationDeclarerSet the max spout pending config for this component.- Specified by:
setMaxSpoutPendingin interfaceComponentConfigurationDeclarer<T extends ComponentConfigurationDeclarer>- Parameters:
val- the value of max spout pending.- Returns:
- this for chaining
-
setNumTasks
public T setNumTasks(Number val)
Description copied from interface:ComponentConfigurationDeclarerSet the number of tasks for this component.- Specified by:
setNumTasksin interfaceComponentConfigurationDeclarer<T extends ComponentConfigurationDeclarer>- Parameters:
val- the number of tasks- Returns:
- this for chaining.
-
setMemoryLoad
public T setMemoryLoad(Number onHeap)
Description copied from interface:ResourceDeclarerSet the amount of on heap memory for this component.- Specified by:
setMemoryLoadin interfaceResourceDeclarer<T extends ComponentConfigurationDeclarer>- Parameters:
onHeap- the amount of on heap memory- Returns:
- this for chaining
-
setMemoryLoad
public T setMemoryLoad(Number onHeap, Number offHeap)
Description copied from interface:ResourceDeclarerSet the amount of memory for this component on and off heap.- Specified by:
setMemoryLoadin interfaceResourceDeclarer<T extends ComponentConfigurationDeclarer>- Parameters:
onHeap- the amount of on heap memoryoffHeap- the amount of off heap memory- Returns:
- this for chaining
-
setCPULoad
public T setCPULoad(Number amount)
Description copied from interface:ResourceDeclarerSet the amount of CPU load for this component.- Specified by:
setCPULoadin interfaceResourceDeclarer<T extends ComponentConfigurationDeclarer>- Parameters:
amount- the amount of CPU- Returns:
- this for chaining
-
addResource
public T addResource(String resourceName, Number resourceValue)
Description copied from interface:ComponentConfigurationDeclarerAdd generic resource for this component.- Specified by:
addResourcein interfaceComponentConfigurationDeclarer<T extends ComponentConfigurationDeclarer>
-
addResources
public T addResources(Map<String,Double> resources)
Add generic resources for this component.- Specified by:
addResourcesin interfaceComponentConfigurationDeclarer<T extends ComponentConfigurationDeclarer>
-
-