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
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis function will be called when the worker needs to shutdown.protected StringcommandFilePath(String dir, String commandTag) protected StringgetImageName(Map<String, Object> topoConf) Get image name from topology Conf.longGet the amount of free memory in MB.voidCalled when starting up.voidreserveResourcesForWorker(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 StringwriteToCommandFile(String workerDir, String command, String commandTag) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:ResourceIsolationInterfaceCalled when starting up.- Specified by:
preparein 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:ResourceIsolationInterfaceThis function should be used prior to starting the worker to reserve resources for the worker.- Specified by:
reserveResourcesForWorkerin 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:ResourceIsolationInterfaceThis 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:
cleanupin 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:ResourceIsolationInterfaceGet the amount of free memory in MB. This might not be the entire box, it might be within a parent resource group.- Specified by:
getSystemFreeMemoryMbin 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
-