public static Writer createWriter(final Configuration conf, final FileSystem fs, final Path path,
    final boolean overwritable, long blocksize) throws IOException {
    // Configuration already does caching for the Class lookup.
    Class<? extends Writer> logWriterClass =
      conf.getClass(WRITER_IMPL, ProtobufLogWriter.class, Writer.class);
    Writer writer = null;
    try {
      writer = logWriterClass.getDeclaredConstructor().newInstance();
      FileSystem rootFs = FileSystem.get(path.toUri(), conf);
      writer.init(rootFs, path, conf, overwritable, blocksize,
        StreamSlowMonitor.create(conf, path.getName()));
      return writer;
    } catch (Exception e) {
      if (e instanceof CommonFSUtils.StreamLacksCapabilityException) {
        LOG.error("The RegionServer write ahead log provider for FileSystem implementations "
          + "relies on the ability to call " + e.getMessage() + " for proper operation during "
          + "component failures, but the current FileSystem does not support doing so. Please "
          + "check the config value of '" + CommonFSUtils.HBASE_WAL_DIR + "' and ensure "
          + "it points to a FileSystem mount that has suitable capabilities for output streams.");
      } else {
        LOG.debug("Error instantiating log writer.", e);
      }
      throw new IOException("cannot get log writer", e);
    }
  }
Public because of FSHLog. Should be package-private
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/FSHLogProvider.java