本文整理汇总了Java中org.apache.hadoop.util.MemoryCalculatorPlugin类的典型用法代码示例。如果您正苦于以下问题:Java MemoryCalculatorPlugin类的具体用法?Java MemoryCalculatorPlugin怎么用?Java MemoryCalculatorPlugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MemoryCalculatorPlugin类属于org.apache.hadoop.util包,在下文中一共展示了MemoryCalculatorPlugin类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDefaultMemoryValues
import org.apache.hadoop.util.MemoryCalculatorPlugin; //导入依赖的package包/类
/**
* Test that verifies default values are configured and reported correctly.
*
* @throws Exception
*/
public void testDefaultMemoryValues()
throws Exception {
JobConf conf = new JobConf();
try {
// Memory values are disabled by default.
conf.setClass(
TaskTracker.MAPRED_TASKTRACKER_MEMORY_CALCULATOR_PLUGIN_PROPERTY,
DummyMemoryCalculatorPlugin.class, MemoryCalculatorPlugin.class);
setUpCluster(conf);
runSleepJob(miniMRCluster.createJobConf());
verifyTestResults();
} finally {
tearDownCluster();
}
}
示例2: testConfiguredMemoryValues
import org.apache.hadoop.util.MemoryCalculatorPlugin; //导入依赖的package包/类
/**
* Test that verifies that configured values are reported correctly.
*
* @throws Exception
*/
public void testConfiguredMemoryValues()
throws Exception {
JobConf conf = new JobConf();
conf.setLong("totalVmemOnTT", 4 * 1024 * 1024 * 1024L);
conf.setLong("totalPmemOnTT", 2 * 1024 * 1024 * 1024L);
conf.setLong("mapSlotMemorySize", 1 * 512L);
conf.setLong("reduceSlotMemorySize", 1 * 1024L);
conf.setClass(
TaskTracker.MAPRED_TASKTRACKER_MEMORY_CALCULATOR_PLUGIN_PROPERTY,
DummyMemoryCalculatorPlugin.class, MemoryCalculatorPlugin.class);
conf.setLong(DummyMemoryCalculatorPlugin.MAXVMEM_TESTING_PROPERTY,
4 * 1024 * 1024 * 1024L);
conf.setLong(DummyMemoryCalculatorPlugin.MAXPMEM_TESTING_PROPERTY,
2 * 1024 * 1024 * 1024L);
conf.setLong(JobTracker.MAPRED_CLUSTER_MAP_MEMORY_MB_PROPERTY,
512L);
conf.setLong(
JobTracker.MAPRED_CLUSTER_REDUCE_MEMORY_MB_PROPERTY, 1024L);
try {
setUpCluster(conf);
JobConf jobConf = miniMRCluster.createJobConf();
jobConf.setMemoryForMapTask(1 * 1024L);
jobConf.setMemoryForReduceTask(2 * 1024L);
runSleepJob(jobConf);
verifyTestResults();
} finally {
tearDownCluster();
}
}