List of usage examples for org.apache.hadoop.mapreduce TaskID isMap
@Deprecated public boolean isMap()
From source file:edu.arizona.cs.hadoop.fs.irods.output.HirodsFileOutputFormat.java
License:Apache License
/** * 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/*from w ww . j a v a 2 s .c om*/ * @param extension the filename extension * @return a string like $name-[mr]-$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.isMap() ? 'm' : 'r'); result.append('-'); result.append(NUMBER_FORMAT.format(partition)); result.append(extension); return result.toString(); }