T
- Must always be the type of the extending class. i.e. public class SubResourceDeclarer extends
DefaultResourceDeclarer<SubResourceDeclarer> {...}
public class DefaultResourceDeclarer<T extends DefaultResourceDeclarer> extends Object implements ResourceDeclarer<T>, ITridentResource
Constructor and Description |
---|
DefaultResourceDeclarer() |
Modifier and Type | Method and 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.
|
public T setMemoryLoad(Number onHeap)
ResourceDeclarer
setMemoryLoad
in interface ResourceDeclarer<T extends DefaultResourceDeclarer>
onHeap
- the amount of on heap memorypublic T setMemoryLoad(Number onHeap, Number offHeap)
ResourceDeclarer
setMemoryLoad
in interface ResourceDeclarer<T extends DefaultResourceDeclarer>
onHeap
- the amount of on heap memoryoffHeap
- the amount of off heap memorypublic T setCPULoad(Number amount)
ResourceDeclarer
setCPULoad
in interface ResourceDeclarer<T extends DefaultResourceDeclarer>
amount
- the amount of CPUpublic Map<String,Number> getResources()
ITridentResource
getResources
in interface ITridentResource
public Set<SharedMemory> getSharedMemory()
ITridentResource
getSharedMemory
in interface ITridentResource
public T addSharedMemory(SharedMemory request)
ResourceDeclarer
SharedOnHeap
, SharedOffHeapWithinNode
, and SharedOffHeapWithinWorker
for convenient ways to create shared memory requests.addSharedMemory
in interface ResourceDeclarer<T extends DefaultResourceDeclarer>
request
- the shared memory request for this componentCopyright © 2023 The Apache Software Foundation. All rights reserved.