当前位置: 首页>>代码示例>>Java>>正文


Java PrivilegedOperationException.getErrorOutput方法代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperationException.getErrorOutput方法的典型用法代码示例。如果您正苦于以下问题:Java PrivilegedOperationException.getErrorOutput方法的具体用法?Java PrivilegedOperationException.getErrorOutput怎么用?Java PrivilegedOperationException.getErrorOutput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperationException的用法示例。


在下文中一共展示了PrivilegedOperationException.getErrorOutput方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: executeDockerLoadCommand

import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperationException; //导入方法依赖的package包/类
private void executeDockerLoadCommand(DockerLoadCommand cmd,
    ContainerRuntimeContext ctx)
    throws ContainerExecutionException {
  Container container = ctx.getContainer();
  String containerIdStr = container.getContainerId().toString();
  String commandFile = dockerClient.writeCommandToTempFile(cmd,
      containerIdStr);
  PrivilegedOperation launchOp = new PrivilegedOperation(
      PrivilegedOperation.OperationType.RUN_DOCKER_CMD);

  launchOp.appendArgs(commandFile);

  try {
    privilegedOperationExecutor.executePrivilegedOperation(null,
        launchOp, null, container.getLaunchContext().getEnvironment(),
        false);
  } catch (PrivilegedOperationException e) {
    LOG.warn("Docker load operation failed. Exception: ", e);
    throw new ContainerExecutionException("Docker load operation failed", e
        .getExitCode(), e.getOutput(), e.getErrorOutput());
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:DockerLinuxContainerRuntime.java

示例2: signalContainer

import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperationException; //导入方法依赖的package包/类
@Override
public void signalContainer(ContainerRuntimeContext ctx)
    throws ContainerExecutionException {
  Container container = ctx.getContainer();
  PrivilegedOperation signalOp = new PrivilegedOperation(
      PrivilegedOperation.OperationType.SIGNAL_CONTAINER, (String) null);

  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()));

  try {
    PrivilegedOperationExecutor executor = PrivilegedOperationExecutor
        .getInstance(conf);

    executor.executePrivilegedOperation(null,
        signalOp, null, container.getLaunchContext().getEnvironment(),
        false);
  } catch (PrivilegedOperationException e) {
    LOG.warn("Signal container failed. Exception: ", e);

    throw new ContainerExecutionException("Signal container failed", e
        .getExitCode(), e.getOutput(), e.getErrorOutput());
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:29,代码来源:ProcessContainerRuntime.java

示例3: signalContainer

import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperationException; //导入方法依赖的package包/类
@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);
  } catch (PrivilegedOperationException e) {
    //Don't log the failure here. Some kinds of signaling failures are
    // acceptable. Let the calling executor decide what to do.
    throw new ContainerExecutionException("Signal container failed", e
        .getExitCode(), e.getOutput(), e.getErrorOutput());
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:32,代码来源:DefaultLinuxContainerRuntime.java

示例4: signalContainer

import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperationException; //导入方法依赖的package包/类
@Override
public void signalContainer(ContainerRuntimeContext ctx)
    throws ContainerExecutionException {
  Container container = ctx.getContainer();
  PrivilegedOperation signalOp = new PrivilegedOperation(
      PrivilegedOperation.OperationType.SIGNAL_CONTAINER, (String) null);

  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()));

  try {
    PrivilegedOperationExecutor executor = PrivilegedOperationExecutor
        .getInstance(conf);

    executor.executePrivilegedOperation(null,
        signalOp, null, container.getLaunchContext().getEnvironment(),
        false);
  } catch (PrivilegedOperationException e) {
    LOG.warn("Signal container failed. Exception: ", e);

    throw new ContainerExecutionException("Signal container failed", e
        .getExitCode(), e.getOutput(), e.getErrorOutput());
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:29,代码来源:DockerLinuxContainerRuntime.java

示例5: signalContainer

import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperationException; //导入方法依赖的package包/类
@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()));

  try {
    PrivilegedOperationExecutor executor = PrivilegedOperationExecutor
        .getInstance(conf);

    executor.executePrivilegedOperation(null,
        signalOp, null, container.getLaunchContext().getEnvironment(),
        false, true);
  } catch (PrivilegedOperationException e) {
    LOG.warn("Signal container failed. Exception: ", e);

    throw new ContainerExecutionException("Signal container failed", e
        .getExitCode(), e.getOutput(), e.getErrorOutput());
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:29,代码来源:DockerLinuxContainerRuntime.java

示例6: signalContainer

import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperationException; //导入方法依赖的package包/类
@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) {
    //Don't log the failure here. Some kinds of signaling failures are
    // acceptable. Let the calling executor decide what to do.
    throw new ContainerExecutionException("Signal container failed", e
        .getExitCode(), e.getOutput(), e.getErrorOutput());
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:32,代码来源:DefaultLinuxContainerRuntime.java

示例7: launchContainer

import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperationException; //导入方法依赖的package包/类
@Override
public void launchContainer(ContainerRuntimeContext ctx)
    throws ContainerExecutionException {
  Container container = ctx.getContainer();
  PrivilegedOperation launchOp = new PrivilegedOperation(
      PrivilegedOperation.OperationType.LAUNCH_CONTAINER, (String) null);

  //All of these arguments are expected to be available in the runtime context
  launchOp.appendArgs(ctx.getExecutionAttribute(RUN_AS_USER),
      ctx.getExecutionAttribute(USER),
      Integer.toString(PrivilegedOperation.
          RunAsUserCommand.LAUNCH_CONTAINER.getValue()),
      ctx.getExecutionAttribute(APPID),
      ctx.getExecutionAttribute(CONTAINER_ID_STR),
      ctx.getExecutionAttribute(CONTAINER_WORK_DIR).toString(),
      ctx.getExecutionAttribute(NM_PRIVATE_CONTAINER_SCRIPT_PATH).toUri()
          .getPath(),
      ctx.getExecutionAttribute(NM_PRIVATE_TOKENS_PATH).toUri().getPath(),
      ctx.getExecutionAttribute(PID_FILE_PATH).toString(),
      StringUtils.join(PrivilegedOperation.LINUX_FILE_PATH_SEPARATOR,
          ctx.getExecutionAttribute(LOCAL_DIRS)),
      StringUtils.join(PrivilegedOperation.LINUX_FILE_PATH_SEPARATOR,
          ctx.getExecutionAttribute(LOG_DIRS)),
      ctx.getExecutionAttribute(RESOURCES_OPTIONS));

  String tcCommandFile = ctx.getExecutionAttribute(TC_COMMAND_FILE);

  if (tcCommandFile != null) {
    launchOp.appendArgs(tcCommandFile);
  }

  //List<String> -> stored as List -> fetched/converted to List<String>
  //we can't do better here thanks to type-erasure
  @SuppressWarnings("unchecked")
  List<String> prefixCommands = (List<String>) ctx.getExecutionAttribute(
      CONTAINER_LAUNCH_PREFIX_COMMANDS);

  try {
    privilegedOperationExecutor.executePrivilegedOperation(prefixCommands,
          launchOp, null, container.getLaunchContext().getEnvironment(),
          false);
  } catch (PrivilegedOperationException e) {
    LOG.warn("Launch container failed. Exception: ", e);

    throw new ContainerExecutionException("Launch container failed", e
        .getExitCode(), e.getOutput(), e.getErrorOutput());
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:49,代码来源:ProcessContainerRuntime.java

示例8: launchContainer

import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperationException; //导入方法依赖的package包/类
@Override
public void launchContainer(ContainerRuntimeContext ctx)
    throws ContainerExecutionException {
  Container container = ctx.getContainer();
  PrivilegedOperation launchOp = new PrivilegedOperation(
      PrivilegedOperation.OperationType.LAUNCH_CONTAINER);

  //All of these arguments are expected to be available in the runtime context
  launchOp.appendArgs(ctx.getExecutionAttribute(RUN_AS_USER),
      ctx.getExecutionAttribute(USER),
      Integer.toString(PrivilegedOperation.
          RunAsUserCommand.LAUNCH_CONTAINER.getValue()),
      ctx.getExecutionAttribute(APPID),
      ctx.getExecutionAttribute(CONTAINER_ID_STR),
      ctx.getExecutionAttribute(CONTAINER_WORK_DIR).toString(),
      ctx.getExecutionAttribute(NM_PRIVATE_CONTAINER_SCRIPT_PATH).toUri()
          .getPath(),
      ctx.getExecutionAttribute(NM_PRIVATE_TOKENS_PATH).toUri().getPath(),
      ctx.getExecutionAttribute(PID_FILE_PATH).toString(),
      StringUtils.join(PrivilegedOperation.LINUX_FILE_PATH_SEPARATOR,
          ctx.getExecutionAttribute(LOCAL_DIRS)),
      StringUtils.join(PrivilegedOperation.LINUX_FILE_PATH_SEPARATOR,
          ctx.getExecutionAttribute(LOG_DIRS)),
      ctx.getExecutionAttribute(RESOURCES_OPTIONS));

  String tcCommandFile = ctx.getExecutionAttribute(TC_COMMAND_FILE);

  if (tcCommandFile != null) {
    launchOp.appendArgs(tcCommandFile);
  }

  //List<String> -> stored as List -> fetched/converted to List<String>
  //we can't do better here thanks to type-erasure
  @SuppressWarnings("unchecked")
  List<String> prefixCommands = (List<String>) ctx.getExecutionAttribute(
      CONTAINER_LAUNCH_PREFIX_COMMANDS);

  try {
    privilegedOperationExecutor.executePrivilegedOperation(prefixCommands,
          launchOp, null, container.getLaunchContext().getEnvironment(),
          false);
  } catch (PrivilegedOperationException e) {
    LOG.warn("Launch container failed. Exception: ", e);

    throw new ContainerExecutionException("Launch container failed", e
        .getExitCode(), e.getOutput(), e.getErrorOutput());
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:49,代码来源:DefaultLinuxContainerRuntime.java

示例9: launchContainer

import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperationException; //导入方法依赖的package包/类
@Override
public void launchContainer(ContainerRuntimeContext ctx)
    throws ContainerExecutionException {
  Container container = ctx.getContainer();
  PrivilegedOperation launchOp = new PrivilegedOperation(
      PrivilegedOperation.OperationType.LAUNCH_CONTAINER);

  //All of these arguments are expected to be available in the runtime context
  launchOp.appendArgs(ctx.getExecutionAttribute(RUN_AS_USER),
      ctx.getExecutionAttribute(USER),
      Integer.toString(PrivilegedOperation.
          RunAsUserCommand.LAUNCH_CONTAINER.getValue()),
      ctx.getExecutionAttribute(APPID),
      ctx.getExecutionAttribute(CONTAINER_ID_STR),
      ctx.getExecutionAttribute(CONTAINER_WORK_DIR).toString(),
      ctx.getExecutionAttribute(NM_PRIVATE_CONTAINER_SCRIPT_PATH).toUri()
          .getPath(),
      ctx.getExecutionAttribute(NM_PRIVATE_TOKENS_PATH).toUri().getPath(),
      ctx.getExecutionAttribute(PID_FILE_PATH).toString(),
      StringUtils.join(PrivilegedOperation.LINUX_FILE_PATH_SEPARATOR,
          ctx.getExecutionAttribute(LOCAL_DIRS)),
      StringUtils.join(PrivilegedOperation.LINUX_FILE_PATH_SEPARATOR,
          ctx.getExecutionAttribute(LOG_DIRS)),
      ctx.getExecutionAttribute(RESOURCES_OPTIONS));

  String tcCommandFile = ctx.getExecutionAttribute(TC_COMMAND_FILE);

  if (tcCommandFile != null) {
    launchOp.appendArgs(tcCommandFile);
  }

  //List<String> -> stored as List -> fetched/converted to List<String>
  //we can't do better here thanks to type-erasure
  @SuppressWarnings("unchecked")
  List<String> prefixCommands = (List<String>) ctx.getExecutionAttribute(
      CONTAINER_LAUNCH_PREFIX_COMMANDS);

  try {
    privilegedOperationExecutor.executePrivilegedOperation(prefixCommands,
          launchOp, null, container.getLaunchContext().getEnvironment(),
          false, false);
  } catch (PrivilegedOperationException e) {
    LOG.warn("Launch container failed. Exception: ", e);

    throw new ContainerExecutionException("Launch container failed", e
        .getExitCode(), e.getOutput(), e.getErrorOutput());
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:49,代码来源:DefaultLinuxContainerRuntime.java


注:本文中的org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperationException.getErrorOutput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。