@InterfaceAudience.Private @InterfaceStability.Unstable public class PrivilegedOperationExecutor extends Object
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.hdfs.protocol.datatransfer.IOStreamPair |
executePrivilegedInteractiveOperation(List<String> prefixCommands,
PrivilegedOperation operation) |
String |
executePrivilegedOperation(List<String> prefixCommands,
PrivilegedOperation operation,
File workingDir,
Map<String,String> env,
boolean grabOutput,
boolean inheritParentEnv)
Executes a privileged operation.
|
String |
executePrivilegedOperation(PrivilegedOperation operation,
boolean grabOutput)
Executes a privileged operation.
|
static String |
getContainerExecutorExecutablePath(org.apache.hadoop.conf.Configuration conf) |
static PrivilegedOperationExecutor |
getInstance(org.apache.hadoop.conf.Configuration conf) |
String[] |
getPrivilegedOperationExecutionCommand(List<String> prefixCommands,
PrivilegedOperation operation) |
static PrivilegedOperation |
squashCGroupOperations(List<PrivilegedOperation> ops)
Squash operations for cgroups - e.g mount, add pid to cgroup etc .,
For now, we only implement squashing for 'add pid to cgroup' since this
is the only optimization relevant to launching containers
|
public static String getContainerExecutorExecutablePath(org.apache.hadoop.conf.Configuration conf)
public static PrivilegedOperationExecutor getInstance(org.apache.hadoop.conf.Configuration conf)
public String[] getPrivilegedOperationExecutionCommand(List<String> prefixCommands, PrivilegedOperation operation)
prefixCommands
- in some cases ( e.g priorities using nice ),
prefix commands are necessaryoperation
- the type and arguments for the operation to be
executedpublic String executePrivilegedOperation(List<String> prefixCommands, PrivilegedOperation operation, File workingDir, Map<String,String> env, boolean grabOutput, boolean inheritParentEnv) throws PrivilegedOperationException
prefixCommands
- in some cases ( e.g priorities using nice ),
prefix commands are necessaryoperation
- the type and arguments for the operation to be executedworkingDir
- (optional) working directory for executionenv
- (optional) env of the command will include specified varsgrabOutput
- return (possibly large) shell command outputinheritParentEnv
- inherit the env vars from the parent processPrivilegedOperationException
public String executePrivilegedOperation(PrivilegedOperation operation, boolean grabOutput) throws PrivilegedOperationException
operation
- the type and arguments for the operation to be executedgrabOutput
- return (possibly large) shell command outputPrivilegedOperationException
public org.apache.hadoop.hdfs.protocol.datatransfer.IOStreamPair executePrivilegedInteractiveOperation(List<String> prefixCommands, PrivilegedOperation operation) throws PrivilegedOperationException, InterruptedException
prefixCommands
- operation
- PrivilegedOperationException
InterruptedException
public static PrivilegedOperation squashCGroupOperations(List<PrivilegedOperation> ops) throws PrivilegedOperationException
PrivilegedOperationException
Copyright © 2008–2023 Apache Software Foundation. All rights reserved.