code: public RecordWriter<Shard, Text> getRecordWriter(final FileSystem fs,
        JobConf job, String name, final Progressable progress)
        throws IOException {
  
      final Path perm = new Path(getWorkOutputPath(job), name);
  
      return new RecordWriter<Shard, Text>() {
        public void write(Shard key, Text value) throws IOException {
          assert (IndexUpdateReducer.DONE.equals(value));
  
          String shardName = key.getDirectory();
          shardName = shardName.replace("/", "_");
  
          Path doneFile =
              new Path(perm, IndexUpdateReducer.DONE + "_" + shardName);
          if (!fs.exists(doneFile)) {
            fs.createNewFile(doneFile);
          }
        }
  
        public void close(final Reporter reporter) throws IOException {
        }
      };
    }
docs: /* (non-Javadoc)
  @see FileOutputFormat#getRecordWriter(FileSystem, JobConf, String, Progressable)