Class FederationUtil

java.lang.Object
org.apache.hadoop.hdfs.server.federation.router.FederationUtil

public final class FederationUtil extends Object
Utilities for managing HDFS federation.
  • Method Details

    • getJmx

      public static org.codehaus.jettison.json.JSONArray getJmx(String beanQuery, String webAddress, org.apache.hadoop.hdfs.web.URLConnectionFactory connectionFactory, String scheme)
      Get a JMX data from a web endpoint.
      Parameters:
      beanQuery - JMX bean.
      webAddress - Web address of the JMX endpoint.
      connectionFactory - to open http/https connection.
      scheme - to use for URL connection.
      Returns:
      JSON with the JMX data
    • getVersion

      public static String getVersion()
      Fetch the Hadoop version string for this jar.
      Returns:
      Hadoop version string, e.g., 3.0.1.
    • getCompileInfo

      public static String getCompileInfo()
      Fetch the build/compile information for this jar.
      Returns:
      String Compilation info.
    • newFileSubclusterResolver

      public static FileSubclusterResolver newFileSubclusterResolver(org.apache.hadoop.conf.Configuration conf, Router router)
      Creates an instance of a FileSubclusterResolver from the configuration.
      Parameters:
      conf - Configuration that defines the file resolver class.
      router - Router service.
      Returns:
      New file subcluster resolver.
    • newActiveNamenodeResolver

      public static ActiveNamenodeResolver newActiveNamenodeResolver(org.apache.hadoop.conf.Configuration conf, StateStoreService stateStore)
      Creates an instance of an ActiveNamenodeResolver from the configuration.
      Parameters:
      conf - Configuration that defines the namenode resolver class.
      stateStore - State store passed to class constructor.
      Returns:
      New active namenode resolver.
    • newSecretManager

      public static org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier> newSecretManager(org.apache.hadoop.conf.Configuration conf)
      Creates an instance of DelegationTokenSecretManager from the configuration.
      Parameters:
      conf - Configuration that defines the token manager class.
      Returns:
      New delegation token secret manager.
    • updateMountPointStatus

      public static org.apache.hadoop.hdfs.protocol.HdfsFileStatus updateMountPointStatus(org.apache.hadoop.hdfs.protocol.HdfsFileStatus dirStatus, int children)
      Add the number of children for an existing HdfsFileStatus object.
      Parameters:
      dirStatus - HdfsfileStatus object.
      children - number of children to be added.
      Returns:
      HdfsFileStatus with the number of children specified.
    • newFairnessPolicyController

      public static RouterRpcFairnessPolicyController newFairnessPolicyController(org.apache.hadoop.conf.Configuration conf)
      Creates an instance of an RouterRpcFairnessPolicyController from the configuration.
      Parameters:
      conf - Configuration that defines the fairness controller class.
      Returns:
      Fairness policy controller.
    • getAllConfiguredNS

      public static Set<String> getAllConfiguredNS(org.apache.hadoop.conf.Configuration conf) throws IllegalArgumentException
      Collect all configured nameservices.
      Parameters:
      conf - the configuration object.
      Returns:
      Set of name services in config.
      Throws:
      IllegalArgumentException - if monitored namenodes are not correctly configured.