Class RegistryOperationsService
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.service.CompositeService
org.apache.hadoop.registry.client.impl.zk.CuratorService
org.apache.hadoop.registry.client.impl.zk.RegistryOperationsService
- All Implemented Interfaces:
Closeable,AutoCloseable,RegistryConstants,RegistryOperations,RegistryBindingSource,Service
- Direct Known Subclasses:
RegistryOperationsClient
@Public
@Evolving
public class RegistryOperationsService
extends org.apache.hadoop.registry.client.impl.zk.CuratorService
implements RegistryOperations
The Registry operations service.
This service implements the RegistryOperations
API by mapping the commands to zookeeper operations, and translating
results and exceptions back into those specified by the API.
Factory methods should hide the detail that this has been implemented via
the CuratorService by returning it cast to that
RegistryOperations interface, rather than this implementation class.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.service.CompositeService
org.apache.hadoop.service.CompositeService.CompositeServiceShutdownHookNested classes/interfaces inherited from interface org.apache.hadoop.service.Service
Service.STATE -
Field Summary
Fields inherited from class org.apache.hadoop.service.CompositeService
STOP_ONLY_STARTED_SERVICESFields inherited from interface org.apache.hadoop.registry.client.api.RegistryConstants
DEFAULT_DNS_ENABLED, DEFAULT_DNS_PORT, DEFAULT_DNS_SPLIT_REVERSE_ZONE, DEFAULT_DNSSEC_PRIVATE_KEY_FILE, DEFAULT_REGISTRY_CLIENT_JAAS_CONTEXT, DEFAULT_REGISTRY_SECURE, DEFAULT_REGISTRY_SYSTEM_ACCOUNTS, DEFAULT_REGISTRY_USER_ACCOUNTS, DEFAULT_REGISTRY_ZK_QUORUM, DEFAULT_ZK_CONNECTION_TIMEOUT, DEFAULT_ZK_REGISTRY_ROOT, DEFAULT_ZK_RETRY_CEILING, DEFAULT_ZK_RETRY_INTERVAL, DEFAULT_ZK_RETRY_TIMES, DEFAULT_ZK_SESSION_TIMEOUT, DNS_PREFIX, KEY_DNS_BIND_ADDRESS, KEY_DNS_DOMAIN, KEY_DNS_ENABLED, KEY_DNS_PORT, KEY_DNS_SPLIT_REVERSE_ZONE, KEY_DNS_SPLIT_REVERSE_ZONE_RANGE, KEY_DNS_TTL, KEY_DNS_ZONE_IP_MAX, KEY_DNS_ZONE_IP_MIN, KEY_DNS_ZONE_MASK, KEY_DNS_ZONE_SUBNET, KEY_DNS_ZONES_DIR, KEY_DNSSEC_ENABLED, KEY_DNSSEC_PRIVATE_KEY_FILE, KEY_DNSSEC_PUBLIC_KEY, KEY_REGISTRY_CLIENT_AUTH, KEY_REGISTRY_CLIENT_AUTHENTICATION_ID, KEY_REGISTRY_CLIENT_AUTHENTICATION_PASSWORD, KEY_REGISTRY_CLIENT_JAAS_CONTEXT, KEY_REGISTRY_KERBEROS_REALM, KEY_REGISTRY_SECURE, KEY_REGISTRY_SYSTEM_ACCOUNTS, KEY_REGISTRY_USER_ACCOUNTS, KEY_REGISTRY_ZK_CONNECTION_TIMEOUT, KEY_REGISTRY_ZK_QUORUM, KEY_REGISTRY_ZK_RETRY_CEILING, KEY_REGISTRY_ZK_RETRY_INTERVAL, KEY_REGISTRY_ZK_RETRY_TIMES, KEY_REGISTRY_ZK_ROOT, KEY_REGISTRY_ZK_SESSION_TIMEOUT, MAX_FQDN_LABEL_LENGTH, PATH_SYSTEM_SERVICES, PATH_USER_SERVICES, PATH_USERS, REGISTRY_CLIENT_AUTH_ANONYMOUS, REGISTRY_CLIENT_AUTH_DIGEST, REGISTRY_CLIENT_AUTH_KERBEROS, REGISTRY_CLIENT_AUTH_SIMPLE, REGISTRY_PREFIX, SUBPATH_COMPONENTS, ZK_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbind(String path, ServiceRecord record, int flags) Bind a path in the registry to a service recordvoidDelete a path.booleanProbe for a path existing.List<org.apache.zookeeper.data.ACL>Get the aggregate set of ACLs the client should use to create directoriesList all entries under a registry path, returning the relative names of the entries.booleanCreate a path.Resolve the record at a pathGet the status of a pathprotected voidvalidatePath(String path) Validate a pathMethods inherited from class org.apache.hadoop.registry.client.impl.zk.CuratorService
addWriteAccessor, bindingDiagnosticDetails, buildConnectionString, buildSecurityDiagnostics, clearWriteAccessors, createEnsembleProvider, createFullPath, dumpPath, dumpRegistryRobustly, getBindingSource, getRegistrySecurity, instantiateCacheForRegistry, isSecure, maybeCreate, operationFailure, operationFailure, registerPathListener, serviceInit, serviceStart, serviceStop, setKerberosPrincipalAndKeytab, startCache, supplyBindingInformation, toString, zkCreate, zkDelete, zkGetACLS, zkList, zkMkParentPath, zkMkPath, zkPathExists, zkPathMustExist, zkRead, zkSet, zkStat, zkUpdateMethods inherited from class org.apache.hadoop.service.CompositeService
addIfService, addService, getServices, removeServiceMethods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.registry.client.api.RegistryOperations
addWriteAccessor, clearWriteAccessorsMethods inherited from interface org.apache.hadoop.service.Service
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, registerServiceListener, start, stop, unregisterServiceListener, waitForServiceToStop
-
Constructor Details
-
RegistryOperationsService
-
RegistryOperationsService
public RegistryOperationsService() -
RegistryOperationsService
-
-
Method Details
-
getClientAcls
Get the aggregate set of ACLs the client should use to create directories- Returns:
- the ACL list
-
validatePath
Validate a path- Parameters:
path- path to validate- Throws:
InvalidPathnameException- if a path is considered invalid
-
mknode
Description copied from interface:RegistryOperationsCreate a path. It is not an error if the path exists already, be it empty or not. The createParents flag also requests creating the parents. As entries in the registry can hold data while still having child entries, it is not an error if any of the parent path elements have service records.- Specified by:
mknodein interfaceRegistryOperations- Parameters:
path- path to createcreateParents- also create the parents.- Returns:
- true if the path was created, false if it existed.
- Throws:
org.apache.hadoop.fs.PathNotFoundException- parent path is not in the registry.InvalidPathnameException- path name is invalid.IOException- Any other IO Exception.
-
bind
Description copied from interface:RegistryOperationsBind a path in the registry to a service record- Specified by:
bindin interfaceRegistryOperations- Parameters:
path- path to service recordrecord- service record service record to create/updateflags- bind flags- Throws:
org.apache.hadoop.fs.PathNotFoundException- the parent path does not existFileAlreadyExistsException- path exists but create flags do not include "overwrite"InvalidPathnameException- path name is invalid.IOException- Any other IO Exception.
-
resolve
Description copied from interface:RegistryOperationsResolve the record at a path- Specified by:
resolvein interfaceRegistryOperations- Parameters:
path- path to an entry containing aServiceRecord- Returns:
- the record
- Throws:
org.apache.hadoop.fs.PathNotFoundException- path is not in the registry.NoRecordException- if there is not a service recordInvalidRecordException- if there was a service record but it could not be parsed.IOException- Any other IO Exception
-
exists
Description copied from interface:RegistryOperationsProbe for a path existing. This is equivalent toRegistryOperations.stat(String)with any failure downgraded to a- Specified by:
existsin interfaceRegistryOperations- Parameters:
path- path to query- Returns:
- true if the path was found
- Throws:
IOException
-
stat
Description copied from interface:RegistryOperationsGet the status of a path- Specified by:
statin interfaceRegistryOperations- Parameters:
path- path to query- Returns:
- the status of the path
- Throws:
org.apache.hadoop.fs.PathNotFoundException- path is not in the registry.InvalidPathnameException- the path is invalid.IOException- Any other IO Exception
-
list
Description copied from interface:RegistryOperationsList all entries under a registry path, returning the relative names of the entries.- Specified by:
listin interfaceRegistryOperations- Parameters:
path- path to query- Returns:
- a possibly empty list of the short path names of child entries.
- Throws:
org.apache.hadoop.fs.PathNotFoundExceptionInvalidPathnameExceptionIOException
-
delete
Description copied from interface:RegistryOperationsDelete a path. If the operation returns without an error then the entry has been deleted.- Specified by:
deletein interfaceRegistryOperations- Parameters:
path- path delete recursivelyrecursive- recursive flag- Throws:
org.apache.hadoop.fs.PathNotFoundException- path is not in the registry.InvalidPathnameException- the path is invalid.org.apache.hadoop.fs.PathIsNotEmptyDirectoryException- path has child entries, but recursive is false.IOException- Any other IO Exception
-