public void write(DataOutput output) throws IOException {
    // serial
    output.writeLong(serialVersionUID);
    // name
    output.writeUTF(name);
    // version number
    output.writeInt(versionNumber.get());
    if (properties != null) {
      // number of properties
      output.writeInt(properties.size());
      // the properties
      for (Map.Entry<String, PropertyType<?>> entry : properties.entrySet()) {
        output.writeUTF(entry.getKey());
        output.writeUTF(entry.getValue().getName());
      }
    } else {
      output.writeInt(0);
    }
    // the values
    if (values != null && properties != null) {
      output.writeInt(values.size());    // the properties
      for (Map.Entry<String, Object> entry : values.entrySet()) {
        String name = entry.getKey();
        PropertyType<?> type = properties.get(name);
        output.writeUTF(name);
        output.writeUTF(type.format(entry.getValue()));
      }
    } else {
      output.writeInt(0);
    }
  }
The serializing write method.

@param output the output stream
@throws IOException if IO fail
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/properties/PropertySchema.java