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


Java LinuxContainerExecutor.mountCgroups方法代码示例

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


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

示例1: init

import org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor; //导入方法依赖的package包/类
@VisibleForTesting
void init(LinuxContainerExecutor lce, ResourceCalculatorPlugin plugin)
    throws IOException {
  initConfig();

  // mount cgroups if requested
  if (cgroupMount && cgroupMountPath != null) {
    ArrayList<String> cgroupKVs = new ArrayList<String>();
    cgroupKVs.add(CONTROLLER_CPU + "=" + cgroupMountPath + "/" +
                  CONTROLLER_CPU);
    lce.mountCgroups(cgroupKVs, cgroupPrefix);
  }

  initializeControllerPaths();

  // cap overall usage to the number of cores allocated to YARN
  yarnProcessors = NodeManagerHardwareUtils.getContainersCores(plugin, conf);
  int systemProcessors = plugin.getNumProcessors();
  if (systemProcessors != (int) yarnProcessors) {
    LOG.info("YARN containers restricted to " + yarnProcessors + " cores");
    int[] limits = getOverallLimits(yarnProcessors);
    updateCgroup(CONTROLLER_CPU, "", CPU_PERIOD_US, String.valueOf(limits[0]));
    updateCgroup(CONTROLLER_CPU, "", CPU_QUOTA_US, String.valueOf(limits[1]));
  } else if (cpuLimitsExist()) {
    LOG.info("Removing CPU constraints for YARN containers.");
    updateCgroup(CONTROLLER_CPU, "", CPU_QUOTA_US, String.valueOf(-1));
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:29,代码来源:CgroupsLCEResourcesHandler.java

示例2: init

import org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor; //导入方法依赖的package包/类
@VisibleForTesting
void init(LinuxContainerExecutor lce, ResourceCalculatorPlugin plugin)
    throws IOException {
  initConfig();

  // mount cgroups if requested
  if (cgroupMount && cgroupMountPath != null) {
    ArrayList<String> cgroupKVs = new ArrayList<String>();
    cgroupKVs.add(CONTROLLER_CPU + "=" + cgroupMountPath + "/" +
                  CONTROLLER_CPU);
    lce.mountCgroups(cgroupKVs, cgroupPrefix);
  }

  initializeControllerPaths();

  nodeVCores = NodeManagerHardwareUtils.getVCores(plugin, conf);

  // cap overall usage to the number of cores allocated to YARN
  yarnProcessors = NodeManagerHardwareUtils.getContainersCPUs(plugin, conf);
  int systemProcessors = NodeManagerHardwareUtils.getNodeCPUs(plugin, conf);
  if (systemProcessors != (int) yarnProcessors) {
    LOG.info("YARN containers restricted to " + yarnProcessors + " cores");
    int[] limits = getOverallLimits(yarnProcessors);
    updateCgroup(CONTROLLER_CPU, "", CPU_PERIOD_US, String.valueOf(limits[0]));
    updateCgroup(CONTROLLER_CPU, "", CPU_QUOTA_US, String.valueOf(limits[1]));
  } else if (cpuLimitsExist()) {
    LOG.info("Removing CPU constraints for YARN containers.");
    updateCgroup(CONTROLLER_CPU, "", CPU_QUOTA_US, String.valueOf(-1));
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:31,代码来源:CgroupsLCEResourcesHandler.java

示例3: init

import org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor; //导入方法依赖的package包/类
public synchronized void init(LinuxContainerExecutor lce) throws IOException {

    this.cgroupPrefix = conf.get(YarnConfiguration.
            NM_LINUX_CONTAINER_CGROUPS_HIERARCHY, "/hadoop-yarn");
    this.cgroupMount = conf.getBoolean(YarnConfiguration.
            NM_LINUX_CONTAINER_CGROUPS_MOUNT, false);
    this.cgroupMountPath = conf.get(YarnConfiguration.
            NM_LINUX_CONTAINER_CGROUPS_MOUNT_PATH, null);

    // remove extra /'s at end or start of cgroupPrefix
    if (cgroupPrefix.charAt(0) == '/') {
      cgroupPrefix = cgroupPrefix.substring(1);
    }

    int len = cgroupPrefix.length();
    if (cgroupPrefix.charAt(len - 1) == '/') {
      cgroupPrefix = cgroupPrefix.substring(0, len - 1);
    }
  
    // mount cgroups if requested
    if (cgroupMount && cgroupMountPath != null) {
      ArrayList<String> cgroupKVs = new ArrayList<String>();
      cgroupKVs.add(CONTROLLER_CPU + "=" + cgroupMountPath + "/" +
                    CONTROLLER_CPU);
      lce.mountCgroups(cgroupKVs, cgroupPrefix);
    }

    initializeControllerPaths();
  }
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:30,代码来源:CgroupsLCEResourcesHandler.java

示例4: init

import org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor; //导入方法依赖的package包/类
public void init(LinuxContainerExecutor lce) throws IOException {
  initConfig();
  
  // mount cgroups if requested
  if (cgroupMount && cgroupMountPath != null) {
    ArrayList<String> cgroupKVs = new ArrayList<String>();
    cgroupKVs.add(CONTROLLER_CPU + "=" + cgroupMountPath + "/" +
                  CONTROLLER_CPU);
    lce.mountCgroups(cgroupKVs, cgroupPrefix);
  }

  initializeControllerPaths();
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:14,代码来源:CgroupsLCEResourcesHandler.java

示例5: init

import org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor; //导入方法依赖的package包/类
@VisibleForTesting
void init(LinuxContainerExecutor lce, ResourceCalculatorPlugin plugin)
    throws IOException {
  initConfig();

  if (isGpuSupportEnabled() && (getGPUAllocator() == null || !getGPUAllocator().isInitialized())) {
    gpuAllocator = GPUAllocator.getInstance();
    getGPUAllocator().initialize(conf);
  }
  
  // mount cgroups if requested
  if (cgroupMount && cgroupMountPath != null) {
    ArrayList<String> cgroupKVs = new ArrayList<String>();
    cgroupKVs.add(CONTROLLER_CPU + "=" + cgroupMountPath + "/" +
        CONTROLLER_CPU);
      cgroupKVs.add(CONTROLLER_DEVICES + "=" + cgroupMountPath + "/" +
          CONTROLLER_DEVICES);
    lce.mountCgroups(cgroupKVs, cgroupPrefix);
  }
  
  initializeControllerPaths();

  nodeVCores = NodeManagerHardwareUtils.getVCores(plugin, conf);
  
  // cap overall usage to the number of cores allocated to YARN
  yarnProcessors = NodeManagerHardwareUtils.getContainersCPUs(plugin, conf);
  int systemProcessors = NodeManagerHardwareUtils.getNodeCPUs(plugin, conf);
  if (systemProcessors != (int) yarnProcessors) {
    LOG.info("YARN containers restricted to " + yarnProcessors + " cores");
    int[] limits = getOverallLimits(yarnProcessors);
    updateCgroup(CONTROLLER_CPU, "", CPU_PERIOD_US, String.valueOf(limits[0]));
    updateCgroup(CONTROLLER_CPU, "", CPU_QUOTA_US, String.valueOf(limits[1]));
  } else if (cpuLimitsExist()) {
    LOG.info("Removing CPU constraints for YARN containers.");
    updateCgroup(CONTROLLER_CPU, "", CPU_QUOTA_US, String.valueOf(-1));
  }

  boolean isDeviceSubsystemPrepared = isDeviceSubsystemPrepared();

  if(!isDeviceSubsystemPrepared) {
      prepareDeviceSubsystem();
    }
  }
 
开发者ID:hopshadoop,项目名称:hops,代码行数:44,代码来源:CgroupsLCEResourcesHandlerGPU.java


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