public class DefaultResourceDeclarer<T extends DefaultResourceDeclarer> extends Object implements ResourceDeclarer<T>, ITridentResource
Default implementation of resources declarer.
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
Set the amount of on heap memory for this component.
setMemoryLoad
in interface ResourceDeclarer<T extends DefaultResourceDeclarer>
onHeap
- the amount of on heap memorypublic T setMemoryLoad(Number onHeap, Number offHeap)
ResourceDeclarer
Set the amount of memory for this component on and off heap.
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
Set the amount of CPU load for this component.
setCPULoad
in interface ResourceDeclarer<T extends DefaultResourceDeclarer>
amount
- the amount of CPUpublic Map<String,Number> getResources()
ITridentResource
Get resource.
getResources
in interface ITridentResource
public Set<SharedMemory> getSharedMemory()
ITridentResource
Get shared memory.
getSharedMemory
in interface ITridentResource
public T addSharedMemory(SharedMemory request)
ResourceDeclarer
Add in request for shared memory that this component will use. See 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 © 2022 The Apache Software Foundation. All rights reserved.