code: public void close() throws MapReduceException {
          try {
              if(writer != null) {
                  writer.flush();
                  writer.close();
              }
          } catch (IOException e) {
              throw new MapReduceException("Failed to close the output collector", e);
          }
      }
docs: Close the output collector
  @throws MapReduceException map reduce exception