Class DefaultResourceDeclarer<T extends DefaultResourceDeclarer>
java.lang.Object
org.apache.storm.trident.operation.DefaultResourceDeclarer<T>
- Type Parameters:
T
- Must always be the type of the extending class. i.e.public class SubResourceDeclarer extends DefaultResourceDeclarer<SubResourceDeclarer> {...}
- All Implemented Interfaces:
ResourceDeclarer<T>
,ITridentResource
- Direct Known Subclasses:
Node
public class DefaultResourceDeclarer<T extends DefaultResourceDeclarer>
extends Object
implements ResourceDeclarer<T>, ITridentResource
Default implementation of resources declarer.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddSharedMemory
(SharedMemory request) Add in request for shared memory that this component will use.Get resource.Get shared memory.setCPULoad
(Number amount) Set the amount of CPU load 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.
-
Constructor Details
-
DefaultResourceDeclarer
public DefaultResourceDeclarer()
-
-
Method Details
-
setMemoryLoad
Description copied from interface:ResourceDeclarer
Set the amount of on heap memory for this component.- Specified by:
setMemoryLoad
in interfaceResourceDeclarer<T extends DefaultResourceDeclarer>
- 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 DefaultResourceDeclarer>
- 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 DefaultResourceDeclarer>
- Parameters:
amount
- the amount of CPU- Returns:
- this for chaining
-
getResources
Description copied from interface:ITridentResource
Get resource.- Specified by:
getResources
in interfaceITridentResource
- Returns:
- a name of resource name -> amount of that resource. *Return should never be null!*
-