use of org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperationExecutor in project hadoop by apache.
the class DefaultLinuxContainerRuntime method signalContainer.
@Override
public void signalContainer(ContainerRuntimeContext ctx) throws ContainerExecutionException {
Container container = ctx.getContainer();
PrivilegedOperation signalOp = new PrivilegedOperation(PrivilegedOperation.OperationType.SIGNAL_CONTAINER);
signalOp.appendArgs(ctx.getExecutionAttribute(RUN_AS_USER), ctx.getExecutionAttribute(USER), Integer.toString(PrivilegedOperation.RunAsUserCommand.SIGNAL_CONTAINER.getValue()), ctx.getExecutionAttribute(PID), Integer.toString(ctx.getExecutionAttribute(SIGNAL).getValue()));
//Some failures here are acceptable. Let the calling executor decide.
signalOp.disableFailureLogging();
try {
PrivilegedOperationExecutor executor = PrivilegedOperationExecutor.getInstance(conf);
executor.executePrivilegedOperation(null, signalOp, null, container.getLaunchContext().getEnvironment(), false, true);
} catch (PrivilegedOperationException e) {
// acceptable. Let the calling executor decide what to do.
throw new ContainerExecutionException("Signal container failed", e.getExitCode(), e.getOutput(), e.getErrorOutput());
}
}
use of org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperationExecutor in project hadoop by apache.
the class DelegatingLinuxContainerRuntime method initialize.
@Override
public void initialize(Configuration conf) throws ContainerExecutionException {
PrivilegedOperationExecutor privilegedOperationExecutor = PrivilegedOperationExecutor.getInstance(conf);
defaultLinuxContainerRuntime = new DefaultLinuxContainerRuntime(privilegedOperationExecutor);
defaultLinuxContainerRuntime.initialize(conf);
dockerLinuxContainerRuntime = new DockerLinuxContainerRuntime(privilegedOperationExecutor);
dockerLinuxContainerRuntime.initialize(conf);
javaSandboxLinuxContainerRuntime = new JavaSandboxLinuxContainerRuntime(privilegedOperationExecutor);
javaSandboxLinuxContainerRuntime.initialize(conf);
}
Aggregations