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


Java ResourceUsageMetrics.setCumulativeCpuUsage方法代码示例

本文整理汇总了Java中org.apache.hadoop.tools.rumen.ResourceUsageMetrics.setCumulativeCpuUsage方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceUsageMetrics.setCumulativeCpuUsage方法的具体用法?Java ResourceUsageMetrics.setCumulativeCpuUsage怎么用?Java ResourceUsageMetrics.setCumulativeCpuUsage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.tools.rumen.ResourceUsageMetrics的用法示例。


在下文中一共展示了ResourceUsageMetrics.setCumulativeCpuUsage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getLoadSplit

import org.apache.hadoop.tools.rumen.ResourceUsageMetrics; //导入方法依赖的package包/类
private LoadSplit getLoadSplit() throws Exception {

    Path[] files = {new Path("one"), new Path("two")};
    long[] start = {1, 2};
    long[] lengths = {100, 200};
    String[] locations = {"locOne", "loctwo"};

    CombineFileSplit cfSplit = new CombineFileSplit(files, start, lengths,
            locations);
    ResourceUsageMetrics metrics = new ResourceUsageMetrics();
    metrics.setCumulativeCpuUsage(200);
    ResourceUsageMetrics[] rMetrics = {metrics};

    double[] reduceBytes = {8.1d, 8.2d};
    double[] reduceRecords = {9.1d, 9.2d};
    long[] reduceOutputBytes = {101L, 102L};
    long[] reduceOutputRecords = {111L, 112L};

    return new LoadSplit(cfSplit, 2, 1, 4L, 5L, 6L, 7L,
            reduceBytes, reduceRecords, reduceOutputBytes, reduceOutputRecords,
            metrics, rMetrics);
  }
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:TestGridMixClasses.java

示例2: testGridmixSplit

import org.apache.hadoop.tools.rumen.ResourceUsageMetrics; //导入方法依赖的package包/类
@Test (timeout=1000)
public void testGridmixSplit() throws Exception {
  Path[] files = {new Path("one"), new Path("two")};
  long[] start = {1, 2};
  long[] lengths = {100, 200};
  String[] locations = {"locOne", "loctwo"};

  CombineFileSplit cfSplit = new CombineFileSplit(files, start, lengths,
          locations);
  ResourceUsageMetrics metrics = new ResourceUsageMetrics();
  metrics.setCumulativeCpuUsage(200);

  double[] reduceBytes = {8.1d, 8.2d};
  double[] reduceRecords = {9.1d, 9.2d};
  long[] reduceOutputBytes = {101L, 102L};
  long[] reduceOutputRecords = {111L, 112L};

  GridmixSplit test = new GridmixSplit(cfSplit, 2, 3, 4L, 5L, 6L, 7L,
          reduceBytes, reduceRecords, reduceOutputBytes, reduceOutputRecords);

  ByteArrayOutputStream data = new ByteArrayOutputStream();
  DataOutputStream out = new DataOutputStream(data);
  test.write(out);
  GridmixSplit copy = new GridmixSplit();
  copy.readFields(new DataInputStream(new ByteArrayInputStream(data
          .toByteArray())));

  // data should be the same
  assertEquals(test.getId(), copy.getId());
  assertEquals(test.getMapCount(), copy.getMapCount());
  assertEquals(test.getInputRecords(), copy.getInputRecords());

  assertEquals(test.getOutputBytes()[0], copy.getOutputBytes()[0]);
  assertEquals(test.getOutputRecords()[0], copy.getOutputRecords()[0]);
  assertEquals(test.getReduceBytes(0), copy.getReduceBytes(0));
  assertEquals(test.getReduceRecords(0), copy.getReduceRecords(0));

}
 
开发者ID:naver,项目名称:hadoop,代码行数:39,代码来源:TestGridMixClasses.java

示例3: createMetrics

import org.apache.hadoop.tools.rumen.ResourceUsageMetrics; //导入方法依赖的package包/类
static ResourceUsageMetrics createMetrics(long target) {
  ResourceUsageMetrics metrics = new ResourceUsageMetrics();
  metrics.setCumulativeCpuUsage(target);
  metrics.setVirtualMemoryUsage(target);
  metrics.setPhysicalMemoryUsage(target);
  metrics.setHeapUsage(target);
  return metrics;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:TestResourceUsageEmulators.java


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