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
Constructors Constructor Description DefaultResourceDeclarer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
addSharedMemory(SharedMemory request)
Add in request for shared memory that this component will use.Map<String,Number>
getResources()
Get resource.Set<SharedMemory>
getSharedMemory()
Get shared memory.T
setCPULoad(Number amount)
Set the amount of CPU load for this component.T
setMemoryLoad(Number onHeap)
Set the amount of on heap memory for this component.T
setMemoryLoad(Number onHeap, Number offHeap)
Set the amount of memory for this component on and off heap.
-
-
-
Method Detail
-
setMemoryLoad
public T setMemoryLoad(Number onHeap)
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
public T setMemoryLoad(Number onHeap, Number offHeap)
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
public T setCPULoad(Number amount)
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
public Map<String,Number> 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!*
-
getSharedMemory
public Set<SharedMemory> getSharedMemory()
Description copied from interface:ITridentResource
Get shared memory.- Specified by:
getSharedMemory
in interfaceITridentResource
- Returns:
- the shared memory region requests
-
addSharedMemory
public T addSharedMemory(SharedMemory request)
Description copied from interface:ResourceDeclarer
Add in request for shared memory that this component will use. SeeSharedOnHeap
,SharedOffHeapWithinNode
, andSharedOffHeapWithinWorker
for convenient ways to create shared memory requests.- Specified by:
addSharedMemory
in interfaceResourceDeclarer<T extends DefaultResourceDeclarer>
- Parameters:
request
- the shared memory request for this component- Returns:
- this for chaining
-
-