public static void doWrite(WALProvider.Writer writer, boolean withTrailer, TableName tableName,
    int columnCount, int recordCount, byte[] row, long timestamp) throws IOException {
    RegionInfo hri = toRegionInfo(tableName);
    for (int i = 0; i < recordCount; i++) {
      writer.append(generateEdit(i, hri, tableName, row, columnCount, timestamp, null));
    }
    writer.sync(false);
    if (withTrailer) {
      writer.close();
    }
  }
Helper class for testing protobuf log.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/ProtobufLogTestHelper.java