|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
@InterfaceAudience.Public @InterfaceStability.Evolving public class RegistryOperationsService
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.
Field Summary |
---|
Fields inherited from class org.apache.hadoop.service.CompositeService |
---|
STOP_ONLY_STARTED_SERVICES |
Constructor Summary | |
---|---|
RegistryOperationsService()
|
|
RegistryOperationsService(String name)
|
|
RegistryOperationsService(String name,
RegistryBindingSource bindingSource)
|
Method Summary | |
---|---|
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 |
Methods inherited from class org.apache.hadoop.registry.client.impl.zk.CuratorService |
---|
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 |
Methods inherited from class org.apache.hadoop.service.CompositeService |
---|
addIfService, addService, getServices, removeService |
Methods 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, waitForServiceToStop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.hadoop.registry.client.api.RegistryOperations |
---|
addWriteAccessor, clearWriteAccessors |
Methods 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 Detail |
---|
public RegistryOperationsService(String name)
public RegistryOperationsService()
public RegistryOperationsService(String name, RegistryBindingSource bindingSource)
Method Detail |
---|
public List<org.apache.zookeeper.data.ACL> getClientAcls()
protected void validatePath(String path) throws InvalidPathnameException
path
- path to validate
InvalidPathnameException
- 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 flags
org.apache.hadoop.fs.PathNotFoundException
- the parent path does not exist
FileAlreadyExistsException
- 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 record
InvalidRecordException
- 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 a
exists
in interface RegistryOperations
path
- path to query
IOException
public RegistryPathStatus stat(String path) throws IOException
RegistryOperations
stat
in interface RegistryOperations
path
- path to query
org.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 query
org.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 flag
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |