public static Path getDnsPath(Path path, Configuration conf) throws MetaException {
    String scheme = path.toUri().getScheme();
    String authority = path.toUri().getAuthority();
    URI defaultUri = FileSystem.getDefaultUri(conf);
    if ((authority == null && scheme == null)
        || StringUtils.equalsIgnoreCase(scheme, defaultUri.getScheme())) {
      if (authority == null) {
        authority = defaultUri.getAuthority();
      }
      if (scheme == null) {
        scheme = defaultUri.getScheme();
      }
      String uriPath = path.toUri().getPath();
      if (StringUtils.isEmpty(uriPath)) {
        uriPath = "/";
      }
      return new Path(scheme, authority, uriPath);
    }
    return path;
  }
Get a path with canonical scheme and authority.
<p>
Since creating a new file system object is expensive, this method
mimics getFileSystem() without creating an actual FileSystem object.
When the input path lacks a scheme or an authority this is added
from the default URI.

@param path
         Path to be canonicalized
@return Path with canonical scheme and authority
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/Warehouse.java