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


Java Values类代码示例

本文整理汇总了Java中org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants.Values的典型用法代码示例。如果您正苦于以下问题:Java Values类的具体用法?Java Values怎么用?Java Values使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Values类属于org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants包,在下文中一共展示了Values类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: scaleInfo

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants.Values; //导入依赖的package包/类
@SuppressWarnings("hiding") 
private TaskAttemptInfo scaleInfo(LoggedTask loggedTask,
    LoggedTaskAttempt loggedAttempt, int locality, int loggedLocality,
    double rackLocalOverNodeLocal, double rackRemoteOverNodeLocal) {
  TaskInfo taskInfo = getTaskInfo(loggedTask);
  double[] factors = new double[] { 1.0, rackLocalOverNodeLocal,
      rackRemoteOverNodeLocal };
  double scaleFactor = factors[locality] / factors[loggedLocality];
  State state = convertState(loggedAttempt.getResult());
  if (loggedTask.getTaskType() == Values.MAP) {
    long taskTime = 0;
    if (loggedAttempt.getStartTime() == 0) {
      taskTime = makeUpMapRuntime(state, locality);
    } else {
      taskTime = loggedAttempt.getFinishTime() - loggedAttempt.getStartTime();
    }
    taskTime = sanitizeTaskRuntime(taskTime, loggedAttempt.getAttemptID());
    taskTime *= scaleFactor;
    return new MapTaskAttemptInfo
      (state, taskInfo, taskTime, loggedAttempt.allSplitVectors());
  } else {
    throw new IllegalArgumentException("taskType can only be MAP: "
        + loggedTask.getTaskType());
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:26,代码来源:ZombieJob.java

示例2: getPre21Value

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants.Values; //导入依赖的package包/类
private static Values getPre21Value(String name) {
  if (name.equalsIgnoreCase("JOB_CLEANUP")) {
    return Values.CLEANUP;
  }
  if (name.equalsIgnoreCase("JOB_SETUP")) {
    return Values.SETUP;
  }

  // Note that pre-21, the task state of a successful task was logged as 
  // SUCCESS while from 21 onwards, its logged as SUCCEEDED.
  if (name.equalsIgnoreCase(TaskStatus.State.SUCCEEDED.toString())) {
    return Values.SUCCESS;
  }
  
  return Values.valueOf(StringUtils.toUpperCase(name));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:JobBuilder.java

示例3: getPre21Value

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants.Values; //导入依赖的package包/类
private static Values getPre21Value(String name) {
  if (name.equalsIgnoreCase("JOB_CLEANUP")) {
    return Values.CLEANUP;
  }
  if (name.equalsIgnoreCase("JOB_SETUP")) {
    return Values.SETUP;
  }

  // Note that pre-21, the task state of a successful task was logged as 
  // SUCCESS while from 21 onwards, its logged as SUCCEEDED.
  if (name.equalsIgnoreCase(TaskStatus.State.SUCCEEDED.toString())) {
    return Values.SUCCESS;
  }
  
  return Values.valueOf(name.toUpperCase());
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:17,代码来源:JobBuilder.java

示例4: scaleInfo

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants.Values; //导入依赖的package包/类
@SuppressWarnings("hiding") 
private TaskAttemptInfo scaleInfo(LoggedTask loggedTask,
    LoggedTaskAttempt loggedAttempt, int locality, int loggedLocality,
    double rackLocalOverNodeLocal, double rackRemoteOverNodeLocal) {
  TaskInfo taskInfo = getTaskInfo(loggedTask);
  double[] factors = new double[] { 1.0, rackLocalOverNodeLocal,
      rackRemoteOverNodeLocal };
  double scaleFactor = factors[locality] / factors[loggedLocality];
  State state = convertState(loggedAttempt.getResult());
  if (loggedTask.getTaskType() == Values.MAP) {
    long taskTime = 0;
    if (loggedAttempt.getStartTime() == 0) {
      taskTime = makeUpMapRuntime(state, locality);
    } else {
      taskTime = loggedAttempt.getFinishTime() - loggedAttempt.getStartTime();
    }
    taskTime = sanitizeTaskRuntime(taskTime, loggedAttempt.getAttemptID());
    taskTime *= scaleFactor;
    return new MapTaskAttemptInfo(state, taskInfo, taskTime);
  } else {
    throw new IllegalArgumentException("taskType can only be MAP: "
        + loggedTask.getTaskType());
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:25,代码来源:ZombieJob.java

示例5: convertState

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants.Values; //导入依赖的package包/类
private static State convertState(Values status) {
  if (status == Values.SUCCESS) {
    return State.SUCCEEDED;
  } else if (status == Values.FAILED) {
    return State.FAILED;
  } else if (status == Values.KILLED) {
    return State.KILLED;
  } else {
    throw new IllegalArgumentException("unknown status " + status);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:ZombieJob.java

示例6: processJobUnsuccessfulCompletionEvent

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants.Values; //导入依赖的package包/类
private void processJobUnsuccessfulCompletionEvent(
    JobUnsuccessfulCompletionEvent event) {
  result.setOutcome(Pre21JobHistoryConstants.Values
      .valueOf(event.getStatus()));
  result.setFinishTime(event.getFinishTime());
  // No counters in JobUnsuccessfulCompletionEvent
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:JobBuilder.java

示例7: processJobFinishedEvent

import org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants.Values; //导入依赖的package包/类
private void processJobFinishedEvent(JobFinishedEvent event) {
  result.setFinishTime(event.getFinishTime());
  result.setJobID(jobID);
  result.setOutcome(Values.SUCCESS);

  JobFinished job = (JobFinished)event.getDatum();
  Map<String, Long> countersMap =
      JobHistoryUtils.extractCounters(job.totalCounters);
  result.putTotalCounters(countersMap);
  countersMap = JobHistoryUtils.extractCounters(job.mapCounters);
  result.putMapCounters(countersMap);
  countersMap = JobHistoryUtils.extractCounters(job.reduceCounters);
  result.putReduceCounters(countersMap);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:JobBuilder.java


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