Interface FileSubclusterResolver

All Known Implementing Classes:
MountTableResolver, MultipleDestinationMountTableResolver

@Private @Evolving public interface FileSubclusterResolver
Interface to map a file path in the global name space to a specific subcluster and path in an HDFS name space.

Each path in the global/federated namespace may map to 1-N different HDFS locations. Each location specifies a single nameservice and a single HDFS path. The behavior is similar to MergeFS and Nfly and allows the merger of multiple HDFS locations into a single path. See HADOOP-8298 and HADOOP-12077

For example, a directory listing will fetch listings for each destination path and combine them into a single set of results.

When multiple destinations are available for a path, the destinations are prioritized in a consistent manner. This allows the proxy server to guess the best/most likely destination and attempt it first.

  • Method Details

    • getDestinationForPath

      PathLocation getDestinationForPath(String path) throws IOException
      Get the destinations for a global path. Results are from the mount table cache. If multiple destinations are available, the first result is the highest priority destination.
      Parameters:
      path - Global path.
      Returns:
      Location in a destination namespace or null if it does not exist.
      Throws:
      IOException - Throws exception if the data is not available.
    • getMountPoints

      List<String> getMountPoints(String path) throws IOException
      Get a list of mount points for a path. Results are from the mount table cache.
      Parameters:
      path - Path to get the mount points under.
      Returns:
      List of mount points present at this path. Return zero-length list if the path is a mount point but there are no mount points under the path. Return null if the path is not a mount point and there are no mount points under the path.
      Throws:
      IOException - Throws exception if the data is not available.
    • getDefaultNamespace

      String getDefaultNamespace()
      Get the default namespace for the cluster.
      Returns:
      Default namespace identifier.
    • getMountPoints

      static List<String> getMountPoints(String path, Collection<String> mountPoints)
      Get a list of mount points for a path.
      Parameters:
      path - Path to get the mount points under.
      mountPoints - the mount points to choose.
      Returns:
      Return empty list if the path is a mount point but there are no mount points under the path. Return null if the path is not a mount point and there are no mount points under the path.