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


Java ResourceCalculatorProcessTree类代码示例

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


ResourceCalculatorProcessTree类属于org.apache.hadoop.yarn.util包,在下文中一共展示了ResourceCalculatorProcessTree类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: ProcessTreeInfo

import org.apache.hadoop.yarn.util.ResourceCalculatorProcessTree; //导入依赖的package包/类
public ProcessTreeInfo(ContainerId containerId, String pid,
    ResourceCalculatorProcessTree pTree, long vmemLimit, long pmemLimit,
    int cpuVcores, int gpuGcores) {
  this.containerId = containerId;
  this.pid = pid;
  this.pTree = pTree;
  this.vmemLimit = vmemLimit;
  this.pmemLimit = pmemLimit;
  this.cpuVcores = cpuVcores;
  this.gpuGcores = gpuGcores;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:ContainersMonitorImpl.java

示例5: isProcessTreeOverLimit

import org.apache.hadoop.yarn.util.ResourceCalculatorProcessTree; //导入依赖的package包/类
boolean isProcessTreeOverLimit(ResourceCalculatorProcessTree pTree,
    String containerId, long limit) {
  long currentMemUsage = pTree.getVirtualMemorySize();
  // as processes begin with an age 1, we want to see if there are processes
  // more than 1 iteration old.
  long curMemUsageOfAgedProcesses = pTree.getVirtualMemorySize(1);
  return isProcessTreeOverLimit(containerId, currentMemUsage,
                                curMemUsageOfAgedProcesses, limit);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:ContainersMonitorImpl.java

示例6: formatErrorMessage

import org.apache.hadoop.yarn.util.ResourceCalculatorProcessTree; //导入依赖的package包/类
private String formatErrorMessage(String memTypeExceeded,
    long currentVmemUsage, long vmemLimit,
    long currentPmemUsage, long pmemLimit,
    String pId, ContainerId containerId, ResourceCalculatorProcessTree pTree) {
  return
    String.format("Container [pid=%s,containerID=%s] is running beyond %s memory limits. ",
        pId, containerId, memTypeExceeded) +
    "Current usage: " +
    formatUsageString(currentVmemUsage, vmemLimit,
                      currentPmemUsage, pmemLimit) +
    ". Killing container.\n" +
    "Dump of the process-tree for " + containerId + " :\n" +
    pTree.getProcessTreeDump();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:ContainersMonitorImpl.java

示例7: updateResourceCounters

import org.apache.hadoop.yarn.util.ResourceCalculatorProcessTree; //导入依赖的package包/类
/**
 * Update resource information counters
 */
void updateResourceCounters() {
  // Update generic resource counters
  updateHeapUsageCounter();

  // Updating resources specified in ResourceCalculatorProcessTree
  if (pTree == null) {
    return;
  }
  pTree.updateProcessTree();
  long cpuTime = pTree.getCumulativeCpuTime();
  long pMem = pTree.getRssMemorySize();
  long vMem = pTree.getVirtualMemorySize();
  // Remove the CPU time consumed previously by JVM reuse
  if (cpuTime != ResourceCalculatorProcessTree.UNAVAILABLE &&
      initCpuCumulativeTime != ResourceCalculatorProcessTree.UNAVAILABLE) {
    cpuTime -= initCpuCumulativeTime;
  }
  
  if (cpuTime != ResourceCalculatorProcessTree.UNAVAILABLE) {
    counters.findCounter(TaskCounter.CPU_MILLISECONDS).setValue(cpuTime);
  }
  
  if (pMem != ResourceCalculatorProcessTree.UNAVAILABLE) {
    counters.findCounter(TaskCounter.PHYSICAL_MEMORY_BYTES).setValue(pMem);
  }

  if (vMem != ResourceCalculatorProcessTree.UNAVAILABLE) {
    counters.findCounter(TaskCounter.VIRTUAL_MEMORY_BYTES).setValue(vMem);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:34,代码来源:Task.java

示例8: ProcessTreeInfo

import org.apache.hadoop.yarn.util.ResourceCalculatorProcessTree; //导入依赖的package包/类
public ProcessTreeInfo(ContainerId containerId, String pid,
    ResourceCalculatorProcessTree pTree, long vmemLimit, long pmemLimit,
    int cpuVcores) {
  this.containerId = containerId;
  this.pid = pid;
  this.pTree = pTree;
  this.vmemLimit = vmemLimit;
  this.pmemLimit = pmemLimit;
  this.cpuVcores = cpuVcores;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:11,代码来源:ContainersMonitorImpl.java

示例9: isProcessTreeOverLimit

import org.apache.hadoop.yarn.util.ResourceCalculatorProcessTree; //导入依赖的package包/类
boolean isProcessTreeOverLimit(ResourceCalculatorProcessTree pTree,
    String containerId, long limit) {
  long currentMemUsage = pTree.getCumulativeVmem();
  // as processes begin with an age 1, we want to see if there are processes
  // more than 1 iteration old.
  long curMemUsageOfAgedProcesses = pTree.getCumulativeVmem(1);
  return isProcessTreeOverLimit(containerId, currentMemUsage,
                                curMemUsageOfAgedProcesses, limit);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:10,代码来源:ContainersMonitorImpl.java

示例10: ProcessTreeInfo

import org.apache.hadoop.yarn.util.ResourceCalculatorProcessTree; //导入依赖的package包/类
public ProcessTreeInfo(ContainerId containerId, String pid,
    ResourceCalculatorProcessTree pTree, long vmemLimit, long pmemLimit) {
  this.containerId = containerId;
  this.pid = pid;
  this.pTree = pTree;
  this.vmemLimit = vmemLimit;
  this.pmemLimit = pmemLimit;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:9,代码来源:ContainersMonitorImpl.java

示例11: onJobInitialize

import org.apache.hadoop.yarn.util.ResourceCalculatorProcessTree; //导入依赖的package包/类
@Override
public void onJobInitialize(InvocationParameters parameters) throws IOException {
    //Take this chance to stub out ResourceCalculatorProcessTree
    parameters.getHadoopInvocationParameters().getConfiguration().setClass(MRConfig.RESOURCE_CALCULATOR_PROCESS_TREE, DummyResourceCalculatorProcessTree.class, ResourceCalculatorProcessTree.class);

    //Initialize the distributed cache
    DistributedCacheManager cacheManager = new DistributedCacheManager();
    cacheManager.setup(parameters.getHadoopInvocationParameters().getConfiguration());
    distributedCaches.put(parameters.getHadoopInvocationParameters().getJobID(), cacheManager);

    super.onJobInitialize(parameters);
}
 
开发者ID:scaleoutsoftware,项目名称:hServer,代码行数:13,代码来源:HadoopVersionSpecificCode_CDH5_YARN.java

示例12: ProcessTreeInfo

import org.apache.hadoop.yarn.util.ResourceCalculatorProcessTree; //导入依赖的package包/类
public ProcessTreeInfo(ContainerId containerId, String pid,
    ResourceCalculatorProcessTree pTree, long vmemLimit, long pmemLimit,
    int cpuVcores, int gpus) {
  this.containerId = containerId;
  this.pid = pid;
  this.pTree = pTree;
  this.vmemLimit = vmemLimit;
  this.pmemLimit = pmemLimit;
  this.cpuVcores = cpuVcores;
  this.gpus = gpus;
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:12,代码来源:ContainersMonitorImpl.java


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