Code example for AbstractMap.SimpleImmutableEntry

0
   * The Mapper class that given a row number, will generate the appropriate output line. 
   */ 
  public static class TTFMapper extends Mapper<Key,Value,NullWritable,Text> {
    @Override 
    public void map(Key row, Value data, Context context) throws IOException, InterruptedException {
      Map.Entry<Key,Value> entry = new SimpleImmutableEntry<Key,Value>(row, data);
      context.write(NullWritable.get(), new Text(DefaultFormatter.formatEntry(entry, false)));
      context.setStatus("Outputed Value"); 
    } 
  } 
 
  @Override 
  public int run(String[] args) throws IOException, InterruptedException, ClassNotFoundException, AccumuloSecurityException {
    Job job = JobUtil.getJob(getConf());
    job.setJobName(this.getClass().getSimpleName() + "_" + System.currentTimeMillis());
    job.setJarByClass(this.getClass());
    Opts opts = new Opts();
    opts.parseArgs(getClass().getName(), args);
 
    job.setInputFormatClass(AccumuloInputFormat.class);