public abstract class OciContainerManager extends Object implements ResourceIsolationInterface
| Modifier and Type | Class and Description |
|---|---|
protected static class |
OciContainerManager.CmdType |
| Modifier and Type | Field and Description |
|---|---|
protected String |
cgroupParent |
protected String |
cgroupRootPath |
protected Map<String,Object> |
conf |
protected String |
memoryCgroupRootPath |
protected MemoryCore |
memoryCoreAtRoot |
protected String |
nscdPath |
protected List<String> |
readonlyBindmounts |
protected List<String> |
readwriteBindmounts |
protected String |
seccompJsonFile |
protected String |
stormHome |
protected static String |
TMP_DIR |
protected Map<String,Object> |
validatedNumaMap |
protected Map<String,List<String>> |
workerToCores |
protected Map<String,Integer> |
workerToCpu |
protected Map<String,Integer> |
workerToMemoryMb |
protected Map<String,String> |
workerToMemoryZone |
| Constructor and Description |
|---|
OciContainerManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup(String user,
String workerId,
int port)
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 |
getSystemFreeMemoryMb()
Get the amount of free memory in MB.
|
void |
prepare(Map<String,Object> conf)
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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitareAllProcessesDead, forceKill, getMemoryUsage, isResourceManaged, kill, launchWorkerProcess, runProfilingCommandprotected String seccompJsonFile
protected String nscdPath
protected static final String TMP_DIR
protected String stormHome
protected String cgroupRootPath
protected String cgroupParent
protected String memoryCgroupRootPath
protected MemoryCore memoryCoreAtRoot
public void prepare(Map<String,Object> conf) throws IOException
ResourceIsolationInterfaceprepare in interface ResourceIsolationInterfaceconf - the cluster configIOException - on any error.public void reserveResourcesForWorker(String workerId, Integer workerMemoryMb, Integer workerCpu, String numaId)
ResourceIsolationInterfacereserveResourcesForWorker in interface ResourceIsolationInterfaceworkerId - 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 topublic void cleanup(String user, String workerId, int port) throws IOException
ResourceIsolationInterfacecleanup in interface ResourceIsolationInterfaceuser - the user of the workerworkerId - worker id to shutdown and clean up afterport - the port of the workerIOExceptionpublic long getSystemFreeMemoryMb()
throws IOException
ResourceIsolationInterfacegetSystemFreeMemoryMb in interface ResourceIsolationInterfaceIOException - on I/O exceptionprotected String getImageName(Map<String,Object> topoConf)
topoConf - topology configurationprotected String writeToCommandFile(String workerDir, String command, String commandTag) throws IOException
IOExceptionCopyright © 2023 The Apache Software Foundation. All rights reserved.