public static void writeToFile(FileSystem fs, Path basePath, DataFormat format) throws IOException {
    Map<String, String> metadata = new HashMap<>();
    metadata.put(Field.VERSION.toString(), CURRENT_VERSION);
    metadata.put(Field.DATA_FORMAT.toString(), format.toString());
    String data = new ObjectMapper().writeValueAsString(metadata);
    try (FSDataOutputStream out = fs
        .create(new Path(basePath, METADATA_FILE)); OutputStreamWriter writer = new OutputStreamWriter(
        out, "UTF-8")) {
      writer.write(data);
      writer.flush();
    }
  }
Writes out an AcidMetaDataFile to the given location
@param fs FileSystem
@param basePath directory to write the file
@param format
@throws IOException
storage-api/src/java/org/apache/hadoop/hive/common/AcidMetaDataFile.java