Example usage for org.apache.hadoop.yarn.util ResourceCalculatorProcessTree getResourceCalculatorProcessTree

List of usage examples for org.apache.hadoop.yarn.util ResourceCalculatorProcessTree getResourceCalculatorProcessTree

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.util ResourceCalculatorProcessTree getResourceCalculatorProcessTree.

Prototype

public static ResourceCalculatorProcessTree getResourceCalculatorProcessTree(String pid,
        Class<? extends ResourceCalculatorProcessTree> clazz, Configuration conf) 

Source Link

Document

Create the ResourceCalculatorProcessTree rooted to specified process from the class name and configure it.

Usage

From source file:org.apache.tez.runtime.metrics.TaskCounterUpdater.java

License:Apache License

private void initResourceCalculatorPlugin() {
    Class<? extends ResourceCalculatorProcessTree> clazz = this.conf.getClass(
            TezConfiguration.TEZ_TASK_RESOURCE_CALCULATOR_PROCESS_TREE_CLASS, null,
            ResourceCalculatorProcessTree.class);

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

    LOG.info(" Using ResourceCalculatorProcessTree : " + pTree);
}

From source file:org.apache.tez.util.TestTezMxBeanResourceCalculator.java

License:Apache License

@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);
}