/**
  * ends a file once all blocks have been written. closes the file.
  *
  * @param extraMetaData the extra meta data to write in the footer
  * @throws IOException
  */
 public void end(Map<String, String> extraMetaData) throws IOException {
   state = state.end();
   if (DEBUG) LOG.debug(out.getPos() + ": end");
   ParquetMetadata footer =
       new ParquetMetadata(new FileMetaData(schema, extraMetaData, Version.FULL_VERSION), blocks);
   serializeFooter(footer, out);
   out.close();
 }