Class RegistryOperationsFactory

java.lang.Object
org.apache.hadoop.registry.client.api.RegistryOperationsFactory

public final class RegistryOperationsFactory extends Object
A factory for registry operation service instances.

Each created instance will be returned initialized.

That is, the service will have had Service.init(conf) applied to it —possibly after the configuration has been modified to support the specific binding/security mechanism used

  • Method Details

    • createInstance

      public static RegistryOperations createInstance(org.apache.hadoop.conf.Configuration conf)
      Create and initialize a registry operations instance. Access writes will be determined from the configuration
      Parameters:
      conf - configuration
      Returns:
      a registry operations instance
      Throws:
      org.apache.hadoop.service.ServiceStateException - on any failure to initialize
    • createInstance

      public static RegistryOperations createInstance(String name, org.apache.hadoop.conf.Configuration conf)
      Create and initialize a registry operations instance. Access rights will be determined from the configuration
      Parameters:
      name - name of the instance
      conf - configuration
      Returns:
      a registry operations instance
      Throws:
      org.apache.hadoop.service.ServiceStateException - on any failure to initialize
    • createClient

      public static RegistryOperationsClient createClient(String name, org.apache.hadoop.conf.Configuration conf)
    • createAnonymousInstance

      public static RegistryOperations createAnonymousInstance(org.apache.hadoop.conf.Configuration conf)
      Create and initialize an anonymous read/write registry operations instance. In a secure cluster, this instance will only have read access to the registry.
      Parameters:
      conf - configuration
      Returns:
      an anonymous registry operations instance
      Throws:
      org.apache.hadoop.service.ServiceStateException - on any failure to initialize
    • createKerberosInstance

      public static RegistryOperations createKerberosInstance(org.apache.hadoop.conf.Configuration conf, String jaasContext)
      Create and initialize an secure, Kerberos-authenticated instance. The user identity will be inferred from the current user The authentication of this instance will expire when any kerberos tokens needed to authenticate with the registry infrastructure expire.
      Parameters:
      conf - configuration
      jaasContext - the JAAS context of the account.
      Returns:
      a registry operations instance
      Throws:
      org.apache.hadoop.service.ServiceStateException - on any failure to initialize
    • createKerberosInstance

      public static RegistryOperations createKerberosInstance(org.apache.hadoop.conf.Configuration conf, String jaasClientEntry, String principal, String keytab)
      Create a kerberos registry service client
      Parameters:
      conf - configuration
      jaasClientEntry - the name of the login config entry
      principal - principal of the client.
      keytab - location to the keytab file
      Returns:
      a registry service client instance
    • createAuthenticatedInstance

      public static RegistryOperations createAuthenticatedInstance(org.apache.hadoop.conf.Configuration conf, String id, String password)
      Create and initialize an operations instance authenticated with write access via an id:password pair. The instance will have the read access across the registry, but write access only to that part of the registry to which it has been give the relevant permissions.
      Parameters:
      conf - configuration
      id - user ID
      password - password
      Returns:
      a registry operations instance
      Throws:
      org.apache.hadoop.service.ServiceStateException - on any failure to initialize
      IllegalArgumentException - if an argument is invalid