@Nullable
  public String getStoragePolicyName(Path path) {
    try {
      Object blockStoragePolicySpi =
        ReflectionUtils.invokeMethod(this.fs, "getStoragePolicy", path);
      return (String) ReflectionUtils.invokeMethod(blockStoragePolicySpi, "getName");
    } catch (Exception e) {
      // Maybe fail because of using old HDFS version, try the old way
      if (LOG.isTraceEnabled()) {
        LOG.trace("Failed to get policy directly", e);
      }
      return getStoragePolicyForOldHDFSVersion(path);
    }
  }
Get the storage policy of the source path (directory/file).
@param path The source path (directory/file).
@return Storage policy name, or {@code null} if not using {@link DistributedFileSystem} or
        exception thrown when trying to get policy
hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java