本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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();
}
}