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


Java Job.getDiagnostics方法代码示例

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


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

示例1: verifyHsJobGenericSecure

import org.apache.hadoop.mapreduce.v2.app.job.Job; //导入方法依赖的package包/类
public static void verifyHsJobGenericSecure(Job job, Boolean uberized,
    String diagnostics, long avgMapTime, long avgReduceTime,
    long avgShuffleTime, long avgMergeTime, int failedReduceAttempts,
    int killedReduceAttempts, int successfulReduceAttempts,
    int failedMapAttempts, int killedMapAttempts, int successfulMapAttempts) {

  String diagString = "";
  List<String> diagList = job.getDiagnostics();
  if (diagList != null && !diagList.isEmpty()) {
    StringBuffer b = new StringBuffer();
    for (String diag : diagList) {
      b.append(diag);
    }
    diagString = b.toString();
  }
  WebServicesTestUtils.checkStringMatch("diagnostics", diagString,
      diagnostics);

  assertEquals("isUber incorrect", job.isUber(), uberized);

  // unfortunately the following fields are all calculated in JobInfo
  // so not easily accessible without doing all the calculations again.
  // For now just make sure they are present.

  assertTrue("failedReduceAttempts not >= 0", failedReduceAttempts >= 0);
  assertTrue("killedReduceAttempts not >= 0", killedReduceAttempts >= 0);
  assertTrue("successfulReduceAttempts not >= 0",
      successfulReduceAttempts >= 0);

  assertTrue("failedMapAttempts not >= 0", failedMapAttempts >= 0);
  assertTrue("killedMapAttempts not >= 0", killedMapAttempts >= 0);
  assertTrue("successfulMapAttempts not >= 0", successfulMapAttempts >= 0);

  assertTrue("avgMapTime not >= 0", avgMapTime >= 0);
  assertTrue("avgReduceTime not >= 0", avgReduceTime >= 0);
  assertTrue("avgShuffleTime not >= 0", avgShuffleTime >= 0);
  assertTrue("avgMergeTime not >= 0", avgMergeTime >= 0);

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

示例2: verifyAMJobGenericSecure

import org.apache.hadoop.mapreduce.v2.app.job.Job; //导入方法依赖的package包/类
public void verifyAMJobGenericSecure(Job job, int mapsPending,
    int mapsRunning, int reducesPending, int reducesRunning,
    Boolean uberized, String diagnostics, int newReduceAttempts,
    int runningReduceAttempts, int failedReduceAttempts,
    int killedReduceAttempts, int successfulReduceAttempts,
    int newMapAttempts, int runningMapAttempts, int failedMapAttempts,
    int killedMapAttempts, int successfulMapAttempts) {

  String diagString = "";
  List<String> diagList = job.getDiagnostics();
  if (diagList != null && !diagList.isEmpty()) {
    StringBuffer b = new StringBuffer();
    for (String diag : diagList) {
      b.append(diag);
    }
    diagString = b.toString();
  }
  WebServicesTestUtils.checkStringMatch("diagnostics", diagString,
      diagnostics);

  assertEquals("isUber incorrect", job.isUber(), uberized);

  // unfortunately the following fields are all calculated in JobInfo
  // so not easily accessible without doing all the calculations again.
  // For now just make sure they are present.
  assertTrue("mapsPending not >= 0", mapsPending >= 0);
  assertTrue("mapsRunning not >= 0", mapsRunning >= 0);
  assertTrue("reducesPending not >= 0", reducesPending >= 0);
  assertTrue("reducesRunning not >= 0", reducesRunning >= 0);

  assertTrue("newReduceAttempts not >= 0", newReduceAttempts >= 0);
  assertTrue("runningReduceAttempts not >= 0", runningReduceAttempts >= 0);
  assertTrue("failedReduceAttempts not >= 0", failedReduceAttempts >= 0);
  assertTrue("killedReduceAttempts not >= 0", killedReduceAttempts >= 0);
  assertTrue("successfulReduceAttempts not >= 0",
      successfulReduceAttempts >= 0);

  assertTrue("newMapAttempts not >= 0", newMapAttempts >= 0);
  assertTrue("runningMapAttempts not >= 0", runningMapAttempts >= 0);
  assertTrue("failedMapAttempts not >= 0", failedMapAttempts >= 0);
  assertTrue("killedMapAttempts not >= 0", killedMapAttempts >= 0);
  assertTrue("successfulMapAttempts not >= 0", successfulMapAttempts >= 0);

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


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