public class RunAsUserContainer extends BasicContainer
Container.ContainerType
_exitedEarly, _localState, _profileCmd, _stormHome
_assignment, _conf, _ops, _port, _supervisorId, _symlinksDisabled, _topoConf, _topologyId, _type, _workerId
Constructor and Description |
---|
RunAsUserContainer(Container.ContainerType type,
Map<String,Object> conf,
String supervisorId,
int port,
LocalAssignment assignment,
LocalState localState,
String workerId) |
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, getWildcardDir, getWorkerClassPath, javaCmd, javaLibraryPath, launch, relaunch, runProfiling, substituteChildopts, substituteChildopts
areAllProcessesDead, cleanUp, createArtifactsLink, createBlobstoreLinks, deleteSavedWorkerUser, forceKill, getAllPids, getWorkerId, getWorkerUser, isProcessAlive, kill, readHeartbeat, readTopoConf, saveWorkerUser, setup, toString, writeLogMetadata
public RunAsUserContainer(Container.ContainerType type, Map<String,Object> conf, String supervisorId, int port, LocalAssignment assignment, LocalState localState, String workerId) 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 logstargetDir
- 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 © 2019 The Apache Software Foundation. All Rights Reserved.