code: public void partitionedOutput(int reduce, K key, 
                                  V value) throws IOException {
      PipesPartitioner.setNextPartition(reduce);
      collector.collect(key, value);
    }
docs: The task output a record with a partition number attached.