public interface ResourceIsolationInterface
A plugin to support resource isolation and limitation within Storm.
Modifier and Type | Method and Description |
---|---|
List<String> |
getLaunchCommand(String workerId,
List<String> existingCommand)
After reserving resources for the worker (i.e.
|
List<String> |
getLaunchCommandPrefix(String workerId)
After reserving resources for the worker (i.e.
|
long |
getMemoryUsage(String workerId)
Get the current memory usage of the a given worker.
|
Set<Long> |
getRunningPids(String workerId)
Get the list of PIDs currently in an isolated container.
|
long |
getSystemFreeMemoryMb()
Get the system free memory in MB.
|
void |
prepare(Map<String,Object> conf)
Called when starting up.
|
void |
releaseResourcesForWorker(String workerId)
This function will be called when the worker needs to shutdown.
|
void |
reserveResourcesForWorker(String workerId,
Integer workerMemory,
Integer workerCpu,
String numaId)
This function should be used prior to starting the worker to reserve resources for the worker.
|
void prepare(Map<String,Object> conf) throws IOException
Called when starting up.
conf
- the cluster configIOException
- on any error.void reserveResourcesForWorker(String workerId, Integer workerMemory, Integer workerCpu, String numaId)
This function should be used prior to starting the worker to reserve resources for the worker.
workerId
- worker id of the worker to startworkerMemory
- the amount of memory for the worker or null if not enforcedworkerCpu
- the amount of cpu for the worker or null if not enforcednumaId
- NUMA zone if applicable the worker should be bound tovoid releaseResourcesForWorker(String workerId)
This function will be called when the worker needs to shutdown. This function should include logic to clean up after a worker is shutdown.
workerId
- worker id to shutdown and clean up afterList<String> getLaunchCommand(String workerId, List<String> existingCommand)
After reserving resources for the worker (i.e. calling reserveResourcesForWorker). This function can be used to get the modified command line to launch the worker with resource isolation
existingCommand
- the current command to run that may need to be modified.List<String> getLaunchCommandPrefix(String workerId)
After reserving resources for the worker (i.e. calling reserveResourcesForWorker). this function can be used to get the launch command prefix
workerId
- the of the workerSet<Long> getRunningPids(String workerId) throws IOException
Get the list of PIDs currently in an isolated container.
workerId
- the id of the worker to get these forIOException
- on any errorlong getMemoryUsage(String workerId) throws IOException
Get the current memory usage of the a given worker.
workerId
- the id of the workerIOException
- on any error.long getSystemFreeMemoryMb() throws IOException
Get the system free memory in MB.
IOException
- on any error.Copyright © 2020 The Apache Software Foundation. All rights reserved.