@InterfaceAudience.Public @InterfaceStability.Evolving public class RegistryOperationsService extends org.apache.hadoop.registry.client.impl.zk.CuratorService implements RegistryOperations
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.
STOP_ONLY_STARTED_SERVICES
DEFAULT_REGISTRY_CLIENT_JAAS_CONTEXT, DEFAULT_REGISTRY_ENABLED, 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, KEY_REGISTRY_CLIENT_AUTH, KEY_REGISTRY_CLIENT_AUTHENTICATION_ID, KEY_REGISTRY_CLIENT_AUTHENTICATION_PASSWORD, KEY_REGISTRY_CLIENT_JAAS_CONTEXT, KEY_REGISTRY_ENABLED, 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, PATH_SYSTEM_SERVICES, PATH_USER_SERVICES, PATH_USERS, REGISTRY_CLIENT_AUTH_ANONYMOUS, REGISTRY_CLIENT_AUTH_DIGEST, REGISTRY_CLIENT_AUTH_KERBEROS, REGISTRY_PREFIX, SUBPATH_COMPONENTS, ZK_PREFIX
Constructor and Description |
---|
RegistryOperationsService() |
RegistryOperationsService(String name) |
RegistryOperationsService(String name,
RegistryBindingSource bindingSource) |
Modifier and Type | Method and Description |
---|---|
void |
bind(String path,
ServiceRecord record,
int flags)
Bind a path in the registry to a service record
|
void |
delete(String path,
boolean recursive)
Delete a path.
|
boolean |
exists(String path)
Probe for a path existing.
|
List<org.apache.zookeeper.data.ACL> |
getClientAcls()
Get the aggregate set of ACLs the client should use
to create directories
|
List<String> |
list(String path)
List all entries under a registry path, returning the relative names
of the entries.
|
boolean |
mknode(String path,
boolean createParents)
Create a path.
|
ServiceRecord |
resolve(String path)
Resolve the record at a path
|
RegistryPathStatus |
stat(String path)
Get the status of a path
|
protected void |
validatePath(String path)
Validate a path
|
addWriteAccessor, bindingDiagnosticDetails, buildConnectionString, buildSecurityDiagnostics, clearWriteAccessors, createEnsembleProvider, createFullPath, dumpPath, dumpRegistryRobustly, getBindingSource, getRegistrySecurity, isSecure, maybeCreate, operationFailure, operationFailure, serviceInit, serviceStart, serviceStop, supplyBindingInformation, toString, zkCreate, zkDelete, zkGetACLS, zkList, zkMkParentPath, zkMkPath, zkPathExists, zkPathMustExist, zkRead, zkSet, zkStat, zkUpdate
addIfService, addService, getServices, removeService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addWriteAccessor, clearWriteAccessors
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, registerServiceListener, start, stop, unregisterServiceListener, waitForServiceToStop
public RegistryOperationsService(String name)
public RegistryOperationsService()
public RegistryOperationsService(String name, RegistryBindingSource bindingSource)
public List<org.apache.zookeeper.data.ACL> getClientAcls()
protected void validatePath(String path) throws InvalidPathnameException
path
- path to validateInvalidPathnameException
- if a path is considered invalidpublic boolean mknode(String path, boolean createParents) throws IOException
RegistryOperations
mknode
in interface RegistryOperations
path
- path to createcreateParents
- also create the parents.org.apache.hadoop.fs.PathNotFoundException
- parent path is not in the registry.InvalidPathnameException
- path name is invalid.IOException
- Any other IO Exception.public void bind(String path, ServiceRecord record, int flags) throws IOException
RegistryOperations
bind
in interface RegistryOperations
path
- path to service recordrecord
- service record service record to create/updateflags
- bind flagsorg.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.public ServiceRecord resolve(String path) throws IOException
RegistryOperations
resolve
in interface RegistryOperations
path
- path to an entry containing a ServiceRecord
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 Exceptionpublic boolean exists(String path) throws IOException
RegistryOperations
RegistryOperations.stat(String)
with
any failure downgraded to aexists
in interface RegistryOperations
path
- path to queryIOException
public RegistryPathStatus stat(String path) throws IOException
RegistryOperations
stat
in interface RegistryOperations
path
- path to queryorg.apache.hadoop.fs.PathNotFoundException
- path is not in the registry.InvalidPathnameException
- the path is invalid.IOException
- Any other IO Exceptionpublic List<String> list(String path) throws IOException
RegistryOperations
list
in interface RegistryOperations
path
- path to queryorg.apache.hadoop.fs.PathNotFoundException
InvalidPathnameException
IOException
public void delete(String path, boolean recursive) throws IOException
RegistryOperations
delete
in interface RegistryOperations
path
- path delete recursivelyrecursive
- recursive flagorg.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 ExceptionCopyright © 2020 Apache Software Foundation. All rights reserved.