Package org.apache.storm.container.oci
Class OciContainerManager
java.lang.Object
org.apache.storm.container.oci.OciContainerManager
- All Implemented Interfaces:
ResourceIsolationInterface
- Direct Known Subclasses:
DockerManager
,RuncLibContainerManager
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
This function will be called when the worker needs to shutdown.protected String
commandFilePath
(String dir, String commandTag) protected String
getImageName
(Map<String, Object> topoConf) Get image name from topology Conf.long
Get the amount of free memory in MB.void
Called when starting up.void
reserveResourcesForWorker
(String workerId, Integer workerMemoryMb, Integer workerCpu, String numaId) This function should be used prior to starting the worker to reserve resources for the worker.protected String
writeToCommandFile
(String workerDir, String command, String commandTag) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.storm.container.ResourceIsolationInterface
areAllProcessesDead, forceKill, getMemoryUsage, isResourceManaged, kill, launchWorkerProcess, runProfilingCommand
-
Field Details
-
conf
-
readonlyBindmounts
-
readwriteBindmounts
-
seccompJsonFile
-
nscdPath
-
TMP_DIR
-
stormHome
-
cgroupRootPath
-
cgroupParent
-
memoryCgroupRootPath
-
memoryCoreAtRoot
-
workerToCpu
-
workerToMemoryMb
-
validatedNumaMap
-
workerToCores
-
workerToMemoryZone
-
-
Constructor Details
-
OciContainerManager
public OciContainerManager()
-
-
Method Details
-
prepare
Description copied from interface:ResourceIsolationInterface
Called when starting up.- Specified by:
prepare
in interfaceResourceIsolationInterface
- Parameters:
conf
- the cluster config- Throws:
IOException
- on any error.
-
reserveResourcesForWorker
public void reserveResourcesForWorker(String workerId, Integer workerMemoryMb, Integer workerCpu, String numaId) Description copied from interface:ResourceIsolationInterface
This function should be used prior to starting the worker to reserve resources for the worker.- Specified by:
reserveResourcesForWorker
in interfaceResourceIsolationInterface
- Parameters:
workerId
- worker id of the worker to startworkerMemoryMb
- 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 to
-
cleanup
Description copied from interface:ResourceIsolationInterface
This function will be called when the worker needs to shutdown. This function should include logic to clean up after a worker is shutdown.- Specified by:
cleanup
in interfaceResourceIsolationInterface
- Parameters:
user
- the user of the workerworkerId
- worker id to shutdown and clean up afterport
- the port of the worker- Throws:
IOException
-
getSystemFreeMemoryMb
Description copied from interface:ResourceIsolationInterface
Get the amount of free memory in MB. This might not be the entire box, it might be within a parent resource group.- Specified by:
getSystemFreeMemoryMb
in interfaceResourceIsolationInterface
- Returns:
- The amount of memory in MB that are free on the system.
- Throws:
IOException
- on I/O exception
-
getImageName
Get image name from topology Conf.- Parameters:
topoConf
- topology configuration- Returns:
- the image name
-
commandFilePath
-
writeToCommandFile
protected String writeToCommandFile(String workerDir, String command, String commandTag) throws IOException - Throws:
IOException
-