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


Java TaskID.getId方法代码示例

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


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

示例1: getUniqueFile

import org.apache.hadoop.mapreduce.TaskID; //导入方法依赖的package包/类
/**
 * Generate a unique filename, based on the task id, name, and extension
 * @param context the task that is calling this
 * @param name the base filename
 * @param extension the filename extension
 * @return a string like $name-[mrsct]-$id$extension
 */
public synchronized static String getUniqueFile(TaskAttemptContext context,
                                                String name,
                                                String extension) {
  TaskID taskId = context.getTaskAttemptID().getTaskID();
  int partition = taskId.getId();
  StringBuilder result = new StringBuilder();
  result.append(name);
  result.append('-');
  result.append(
      TaskID.getRepresentingCharacter(taskId.getTaskType()));
  result.append('-');
  result.append(NUMBER_FORMAT.format(partition));
  result.append(extension);
  return result.toString();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:FileOutputFormat.java

示例2: maskAttemptID

import org.apache.hadoop.mapreduce.TaskID; //导入方法依赖的package包/类
/**
 * Mask the job ID part in a {@link TaskAttemptID}.
 * 
 * @param attemptId
 *          raw {@link TaskAttemptID} read from trace
 * @return masked {@link TaskAttemptID} with empty {@link JobID}.
 */
private TaskAttemptID maskAttemptID(TaskAttemptID attemptId) {
  JobID jobId = new JobID();
  TaskType taskType = attemptId.getTaskType();
  TaskID taskId = attemptId.getTaskID();
  return new TaskAttemptID(jobId.getJtIdentifier(), jobId.getId(), taskType,
      taskId.getId(), attemptId.getId());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:ZombieJob.java

示例3: tipFailed

import org.apache.hadoop.mapreduce.TaskID; //导入方法依赖的package包/类
public synchronized void tipFailed(TaskID taskId) {
  if (!finishedMaps[taskId.getId()]) {
    finishedMaps[taskId.getId()] = true;
    if (--remainingMaps == 0) {
      notifyAll();
    }
    updateStatus();
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:ShuffleSchedulerImpl.java

示例4: getUniqueName

import org.apache.hadoop.mapreduce.TaskID; //导入方法依赖的package包/类
protected String getUniqueName(String name, String extension) {
  int partition;
  
  NumberFormat numberFormat = NumberFormat.getInstance();
  numberFormat.setMinimumIntegerDigits(5);
  numberFormat.setGroupingUsed(false);
  
  if (null != getTaskAttemptContext()) {
    TaskID taskId = getTaskAttemptContext().getTaskAttemptID().getTaskID();
    partition = taskId.getId();
  } else {
    partition = getConfiguration().getInt(JobContext.TASK_PARTITION, -1);
  } 
  if (partition == -1) {
    throw new IllegalArgumentException("This method can only be called from an application");
  }
  
  String taskType = getConfiguration().getBoolean(JobContext.TASK_ISMAP, JobContext.DEFAULT_TASK_ISMAP) ? "m" : "r";
  
  StringBuilder result = new StringBuilder();
  result.append(name);
  result.append('-');
  result.append(taskType);
  result.append('-');
  result.append(numberFormat.format(partition));
  result.append(extension);
  return result.toString();
  
}
 
开发者ID:apache,项目名称:mnemonic,代码行数:30,代码来源:MneDurableOutputSession.java

示例5: maskTaskID

import org.apache.hadoop.mapreduce.TaskID; //导入方法依赖的package包/类
/**
 * Mask the job ID part in a {@link TaskID}.
 * 
 * @param taskId
 *          raw {@link TaskID} read from trace
 * @return masked {@link TaskID} with empty {@link JobID}.
 */
private TaskID maskTaskID(TaskID taskId) {
  JobID jobId = new JobID();
  TaskType taskType = taskId.getTaskType();
  return new TaskID(jobId, taskType, taskId.getId());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:ZombieJob.java


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