Class RegistryOperationsFactory
java.lang.Object
org.apache.hadoop.registry.client.api.RegistryOperationsFactory
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 Summary
Modifier and TypeMethodDescriptionstatic RegistryOperationscreateAnonymousInstance(org.apache.hadoop.conf.Configuration conf) Create and initialize an anonymous read/write registry operations instance.static RegistryOperationscreateAuthenticatedInstance(org.apache.hadoop.conf.Configuration conf, String id, String password) Create and initialize an operations instance authenticated with write access via anid:passwordpair.static RegistryOperationsClientcreateClient(String name, org.apache.hadoop.conf.Configuration conf) static RegistryOperationscreateInstance(String name, org.apache.hadoop.conf.Configuration conf) Create and initialize a registry operations instance.static RegistryOperationscreateInstance(org.apache.hadoop.conf.Configuration conf) Create and initialize a registry operations instance.static RegistryOperationscreateKerberosInstance(org.apache.hadoop.conf.Configuration conf, String jaasContext) Create and initialize an secure, Kerberos-authenticated instance.static RegistryOperationscreateKerberosInstance(org.apache.hadoop.conf.Configuration conf, String jaasClientEntry, String principal, String keytab) Create a kerberos registry service client
-
Method Details
-
createInstance
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 instanceconf- 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
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- configurationjaasContext- 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- configurationjaasClientEntry- the name of the login config entryprincipal- 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 anid:passwordpair. 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- configurationid- user IDpassword- password- Returns:
- a registry operations instance
- Throws:
org.apache.hadoop.service.ServiceStateException- on any failure to initializeIllegalArgumentException- if an argument is invalid
-