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


Java ResourceCalculatorProcessTree.getResourceCalculatorProcessTree方法代码示例

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


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

示例1: initialize

import org.apache.hadoop.yarn.util.ResourceCalculatorProcessTree; //导入方法依赖的package包/类
public void initialize() {
  Class<? extends ResourceCalculatorProcessTree> clazz =
      PSAgentContext
          .get()
          .getConf()
          .getClass(MRConfig.RESOURCE_CALCULATOR_PROCESS_TREE, null,
              ResourceCalculatorProcessTree.class);
  pTree =
      ResourceCalculatorProcessTree.getResourceCalculatorProcessTree(
          System.getenv().get("JVM_PID"), clazz, PSAgentContext.get().getConf());
  if (pTree != null) {
    pTree.updateProcessTree();
    initCpuCumulativeTime = pTree.getCumulativeCpuTime();
  }
  LOG.info(" Using ResourceCalculatorProcessTree : " + pTree);
}
 
开发者ID:Tencent,项目名称:angel,代码行数:17,代码来源:CounterUpdater.java

示例2: isEnabled

import org.apache.hadoop.yarn.util.ResourceCalculatorProcessTree; //导入方法依赖的package包/类
private boolean isEnabled() {
  if (resourceCalculatorPlugin == null) {
          LOG.info("ResourceCalculatorPlugin is unavailable on this system. "
              + this.getClass().getName() + " is disabled.");
          return false;
  }
  if (ResourceCalculatorProcessTree.getResourceCalculatorProcessTree("0", processTreeClass, conf) == null) {
      LOG.info("ResourceCalculatorProcessTree is unavailable on this system. "
              + this.getClass().getName() + " is disabled.");
          return false;
  }
  if (!(isPmemCheckEnabled() || isVmemCheckEnabled())) {
    LOG.info("Neither virutal-memory nor physical-memory monitoring is " +
        "needed. Not running the monitor-thread");
    return false;
  }

  return true;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:ContainersMonitorImpl.java

示例3: initResourceCalculatorPlugins

import org.apache.hadoop.yarn.util.ResourceCalculatorProcessTree; //导入方法依赖的package包/类
private void initResourceCalculatorPlugins() {
  Class<? extends ResourceCalculatorProcessTree> clazz = amConf.getClass(
      TezConfiguration.TEZ_TASK_RESOURCE_CALCULATOR_PROCESS_TREE_CLASS,
      TezMxBeanResourceCalculator.class,
      ResourceCalculatorProcessTree.class);

  // this is set by YARN NM
  String pid = System.getenv().get("JVM_PID");
  // for the local debug test cases fallback to JVM hooks that are not portable
  if (pid == null || pid.length() == 0) {
    String processName = java.lang.management.ManagementFactory.getRuntimeMXBean().getName();
    pid = processName.split("@")[0];
  }
  cpuPlugin = ResourceCalculatorProcessTree.getResourceCalculatorProcessTree(pid, clazz, amConf);
  
  gcPlugin = new GcTimeUpdater(null);
}
 
开发者ID:apache,项目名称:tez,代码行数:18,代码来源:DAGAppMaster.java

示例4: initResourceCalculatorPlugin

import org.apache.hadoop.yarn.util.ResourceCalculatorProcessTree; //导入方法依赖的package包/类
private void initResourceCalculatorPlugin() {
  Class<? extends ResourceCalculatorProcessTree> clazz = this.conf.getClass(
      TezJobConfig.TEZ_RUNTIME_RESOURCE_CALCULATOR_PROCESS_TREE_CLASS, null,
      ResourceCalculatorProcessTree.class); 

  pTree = ResourceCalculatorProcessTree.getResourceCalculatorProcessTree(
      System.getenv().get("JVM_PID"), clazz, conf);

  LOG.info(" Using ResourceCalculatorProcessTree : " + pTree);
}
 
开发者ID:apache,项目名称:incubator-tez,代码行数:11,代码来源:TaskCounterUpdater.java

示例5: setup

import org.apache.hadoop.yarn.util.ResourceCalculatorProcessTree; //导入方法依赖的package包/类
@Before
public void setup() throws Exception {
  Configuration conf = new TezConfiguration();
  conf.set(TezConfiguration.TEZ_TASK_RESOURCE_CALCULATOR_PROCESS_TREE_CLASS,
      TezMxBeanResourceCalculator.class.getName());

  Class<? extends ResourceCalculatorProcessTree> clazz = conf.getClass(
      TezConfiguration.TEZ_TASK_RESOURCE_CALCULATOR_PROCESS_TREE_CLASS, null,
      ResourceCalculatorProcessTree.class);
  resourceCalculator = ResourceCalculatorProcessTree.getResourceCalculatorProcessTree(
      "", clazz, conf);
}
 
开发者ID:apache,项目名称:tez,代码行数:13,代码来源:TestTezMxBeanResourceCalculator.java

示例6: initResourceCalculatorPlugin

import org.apache.hadoop.yarn.util.ResourceCalculatorProcessTree; //导入方法依赖的package包/类
private void initResourceCalculatorPlugin() {
  Class<? extends ResourceCalculatorProcessTree> clazz = this.conf.getClass(
      TezConfiguration.TEZ_TASK_RESOURCE_CALCULATOR_PROCESS_TREE_CLASS,
      TezMxBeanResourceCalculator.class,
      ResourceCalculatorProcessTree.class); 

  pTree = ResourceCalculatorProcessTree.getResourceCalculatorProcessTree(pid, clazz, conf);

  LOG.info("Using ResourceCalculatorProcessTree : " + clazz.getName());
}
 
开发者ID:apache,项目名称:tez,代码行数:11,代码来源:TaskCounterUpdater.java

示例7: initialize

import org.apache.hadoop.yarn.util.ResourceCalculatorProcessTree; //导入方法依赖的package包/类
public void initialize(JobConf job, JobID id, 
                       Reporter reporter,
                       boolean useNewApi) throws IOException, 
                                                 ClassNotFoundException,
                                                 InterruptedException {
  jobContext = new JobContextImpl(job, id, reporter);
  taskContext = new TaskAttemptContextImpl(job, taskId, reporter);
  if (getState() == TaskStatus.State.UNASSIGNED) {
    setState(TaskStatus.State.RUNNING);
  }
  if (useNewApi) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("using new api for output committer");
    }
    outputFormat =
      ReflectionUtils.newInstance(taskContext.getOutputFormatClass(), job);
    committer = outputFormat.getOutputCommitter(taskContext);
  } else {
    committer = conf.getOutputCommitter();
  }
  Path outputPath = FileOutputFormat.getOutputPath(conf);
  if (outputPath != null) {
    if ((committer instanceof FileOutputCommitter)) {
      FileOutputFormat.setWorkOutputPath(conf, 
        ((FileOutputCommitter)committer).getTaskAttemptPath(taskContext));
    } else {
      FileOutputFormat.setWorkOutputPath(conf, outputPath);
    }
  }
  committer.setupTask(taskContext);
  Class<? extends ResourceCalculatorProcessTree> clazz =
      conf.getClass(MRConfig.RESOURCE_CALCULATOR_PROCESS_TREE,
          null, ResourceCalculatorProcessTree.class);
  pTree = ResourceCalculatorProcessTree
          .getResourceCalculatorProcessTree(System.getenv().get("JVM_PID"), clazz, conf);
  LOG.info(" Using ResourceCalculatorProcessTree : " + pTree);
  if (pTree != null) {
    pTree.updateProcessTree();
    initCpuCumulativeTime = pTree.getCumulativeCpuTime();
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:42,代码来源:Task.java


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