Class RouterResolver<K,V>

java.lang.Object
org.apache.hadoop.hdfs.server.federation.resolver.order.RouterResolver<K,V>
Type Parameters:
K - The key type of subcluster mapping info queried from Router.
V - The value type of subcluster mapping info queried from Router.
All Implemented Interfaces:
OrderedResolver
Direct Known Subclasses:
AvailableSpaceResolver, LocalResolver

public abstract class RouterResolver<K,V> extends Object implements OrderedResolver
The order resolver that depends upon the Router service.
  • Field Details

    • MIN_UPDATE_PERIOD_KEY

      public static final String MIN_UPDATE_PERIOD_KEY
      Configuration key to set the minimum time to update subcluster info.
      See Also:
  • Constructor Details

    • RouterResolver

      public RouterResolver(org.apache.hadoop.conf.Configuration conf, Router routerService)
  • Method Details

    • getFirstNamespace

      public String getFirstNamespace(String path, PathLocation loc)
      Description copied from interface: OrderedResolver
      Get the first namespace based on this resolver approach.
      Specified by:
      getFirstNamespace in interface OrderedResolver
      Parameters:
      path - Path to check.
      loc - Federated location with multiple destinations.
      Returns:
      First namespace out of the locations.
    • getSubclusterInfo

      protected abstract Map<K,V> getSubclusterInfo(MembershipStore membershipStore)
      The implementation for getting desired subcluster mapping info.
      Parameters:
      membershipStore - Membership store the resolver queried from.
      Returns:
      The map of desired type info.
    • chooseFirstNamespace

      protected abstract String chooseFirstNamespace(String path, PathLocation loc)
      Choose the first namespace from queried subcluster mapping info.
      Parameters:
      path - Path to check.
      loc - Federated location with multiple destinations.
      Returns:
      First namespace out of the locations.
    • getRpcServer

      protected RouterRpcServer getRpcServer()
      Get the Router RPC server.
      Returns:
      Router RPC server. Null if not possible.
    • getMembershipStore

      protected MembershipStore getMembershipStore()
      Get the Membership store.
      Returns:
      Membership store.
    • getSubclusterMapping

      protected Map<K,V> getSubclusterMapping()
      Get subcluster mapping info.
      Returns:
      The map of subcluster info.