public class RunAsUserContainer extends BasicContainer
Container.ContainerType
exitedEarly, hardMemoryLimitMultiplier, hardMemoryLimitOver, localState, lowMemoryThresholdMb, mediumMemoryGracePeriodMs, mediumMemoryThresholdMb, memoryLimitExceededStart, memoryLimitMb, profileCmd, stormHome
assignment, conf, containerMemoryTracker, ops, port, resourceIsolationManager, supervisorId, supervisorPort, symlinksDisabled, topoConf, topologyId, type, workerId
Constructor and Description |
---|
RunAsUserContainer(Container.ContainerType type,
Map<String,Object> conf,
String supervisorId,
int supervisorPort,
int port,
LocalAssignment assignment,
ResourceIsolationInterface resourceIsolationManager,
LocalState localState,
String workerId,
StormMetricsRegistry metricsRegistry,
ContainerMemoryTracker containerMemoryTracker) |
Modifier and Type | Method and Description |
---|---|
protected void |
forceKill(long pid)
Kill a given process.
|
protected String |
getRunWorkerAsUser()
If ‘supervisor.run.worker.as.user’ is set, worker will be launched as the user that launched the topology.
|
protected void |
kill(long pid)
Kill a given process.
|
protected void |
launchWorkerProcess(List<String> command,
Map<String,String> env,
String logPrefix,
ExitCodeCallback processExitCallback,
File targetDir)
Launch the worker process (non-blocking).
|
protected boolean |
runProfilingCommand(List<String> command,
Map<String,String> env,
String logPrefix,
File targetDir)
Run the given command for profiling.
|
cleanUpForRestart, createNewWorkerId, didMainProcessExit, frameworkClasspath, getDependencyLocationsFor, getMemoryReservationMb, getMemoryUsageMb, getStormVersionFor, getWildcardDir, getWorkerClassPath, getWorkerLogWriter, getWorkerMain, isMemoryLimitViolated, javaCmd, javaLibraryPath, launch, relaunch, runProfiling, substituteChildopts, substituteChildopts
areAllProcessesDead, cleanUp, createArtifactsLink, createBlobstoreLinks, deleteSavedWorkerUser, forceKill, getAllPids, getTotalTopologyMemoryReserved, getTotalTopologyMemoryUsed, getTotalWorkersForThisTopology, getWorkerId, getWorkerUser, isProcessAlive, kill, readHeartbeat, readTopoConf, saveWorkerUser, setup, toString, updateMemoryAccounting, writeLogMetadata
public RunAsUserContainer(Container.ContainerType type, Map<String,Object> conf, String supervisorId, int supervisorPort, int port, LocalAssignment assignment, ResourceIsolationInterface resourceIsolationManager, LocalState localState, String workerId, StormMetricsRegistry metricsRegistry, ContainerMemoryTracker containerMemoryTracker) throws IOException
IOException
protected void kill(long pid) throws IOException
Container
Kill a given process.
kill
in class Container
pid
- the id of the process to killIOException
protected void forceKill(long pid) throws IOException
Container
Kill a given process.
forceKill
in class Container
pid
- the id of the process to killIOException
protected boolean runProfilingCommand(List<String> command, Map<String,String> env, String logPrefix, File targetDir) throws IOException, InterruptedException
BasicContainer
Run the given command for profiling.
runProfilingCommand
in class BasicContainer
command
- the command to runenv
- the environment to run the commandlogPrefix
- the prefix to include in the logstargetDir
- the working directory to run the command inIOException
- on any errorInterruptedException
- if interrupted wile waiting for the process to exit.protected void launchWorkerProcess(List<String> command, Map<String,String> env, String logPrefix, ExitCodeCallback processExitCallback, File targetDir) throws IOException
BasicContainer
Launch the worker process (non-blocking).
launchWorkerProcess
in class BasicContainer
command
- the command to runenv
- the environment to run the commandlogPrefix
- the prefix to include in the logsprocessExitCallback
- a callback for when the process exitstargetDir
- the working directory to run the command inIOException
- on any errorprotected String getRunWorkerAsUser()
If ‘supervisor.run.worker.as.user’ is set, worker will be launched as the user that launched the topology.
getRunWorkerAsUser
in class Container
Copyright © 2022 The Apache Software Foundation. All rights reserved.