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


Java MemoryCalculatorPlugin类代码示例

本文整理汇总了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();
  }
}
 
开发者ID:thisisvoa,项目名称:hadoop-0.20,代码行数:21,代码来源:TestTTMemoryReporting.java

示例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();
  }
}
 
开发者ID:thisisvoa,项目名称:hadoop-0.20,代码行数:37,代码来源:TestTTMemoryReporting.java


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