public static FSDataOutputStream create(Configuration conf, FileSystem fs, Path path,
    FsPermission perm, InetSocketAddress[] favoredNodes) throws IOException {
    if (fs instanceof HFileSystem) {
      FileSystem backingFs = ((HFileSystem) fs).getBackingFs();
      if (backingFs instanceof DistributedFileSystem) {
        short replication = Short.parseShort(conf.get(ColumnFamilyDescriptorBuilder.DFS_REPLICATION,
          String.valueOf(ColumnFamilyDescriptorBuilder.DEFAULT_DFS_REPLICATION)));
        DistributedFileSystem.HdfsDataOutputStreamBuilder builder =
          ((DistributedFileSystem) backingFs).createFile(path).recursive().permission(perm)
            .create();
        if (favoredNodes != null) {
          builder.favoredNodes(favoredNodes);
        }
        if (replication > 0) {
          builder.replication(replication);
        }
        return builder.build();
      }

    }
    return CommonFSUtils.create(fs, path, perm, true);
  }
Create the specified file on the filesystem. By default, this will:
<ol>
<li>overwrite the file if it exists</li>
<li>apply the umask in the configuration (if it is enabled)</li>
<li>use the fs configured buffer size (or 4096 if not set)</li>
<li>use the configured column family replication or default replication if
{@link ColumnFamilyDescriptorBuilder#DEFAULT_DFS_REPLICATION}</li>
<li>use the default block size</li>
<li>not track progress</li>
</ol>
@param conf         configurations
@param fs           {@link FileSystem} on which to write the file
@param path         {@link Path} to the file to write
@param perm         permissions
@param favoredNodes favored data nodes
@return output stream to the created file
@throws IOException if the file cannot be created
hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java