private boolean writeMsckResult(Set<?> result, String msg,
    Writer out, boolean wrote) throws IOException {

    if (!result.isEmpty()) {
      if (wrote) {
        out.write(terminator);
      }

      out.write(msg);
      for (Object entry : result) {
        out.write(separator);
        out.write(entry.toString());
      }
      return true;
    }

    return false;
  }
Write the result of msck to a writer.

@param result The result we're going to write
@param msg    Message to write.
@param out    Writer to write to
@param wrote  if any previous call wrote data
@return true if something was written
@throws IOException In case the writing fails
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Msck.java