public class FSRegistryOperationsService extends org.apache.hadoop.service.CompositeService implements RegistryOperations
Constructor and Description |
---|
FSRegistryOperationsService() |
Modifier and Type | Method and Description |
---|---|
boolean |
addWriteAccessor(String id,
String pass)
Add a new write access entry to be added to node permissions in all
future write operations of a session connected to a secure registry.
|
void |
bind(String path,
ServiceRecord record,
int flags)
Bind a path in the registry to a service record
|
void |
clearWriteAccessors()
Clear all write accessors.
|
void |
delete(String path,
boolean recursive)
Delete a path.
|
boolean |
exists(String path)
Probe for a path existing.
|
org.apache.hadoop.fs.FileSystem |
getFs() |
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
|
protected void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
RegistryPathStatus |
stat(String path)
Get the status of a path
|
addIfService, addService, getServices, removeService, serviceStart, serviceStop
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
public org.apache.hadoop.fs.FileSystem getFs()
protected void serviceInit(org.apache.hadoop.conf.Configuration conf)
serviceInit
in class org.apache.hadoop.service.CompositeService
public boolean mknode(String path, boolean createParents) throws org.apache.hadoop.fs.PathNotFoundException, InvalidPathnameException, 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 org.apache.hadoop.fs.PathNotFoundException, org.apache.hadoop.fs.FileAlreadyExistsException, InvalidPathnameException, 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 existorg.apache.hadoop.fs.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 org.apache.hadoop.fs.PathNotFoundException, NoRecordException, InvalidRecordException, 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 RegistryPathStatus stat(String path) throws org.apache.hadoop.fs.PathNotFoundException, InvalidPathnameException, 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 boolean exists(String path) throws IOException
RegistryOperations
RegistryOperations.stat(String)
with
any failure downgraded to aexists
in interface RegistryOperations
path
- path to queryIOException
public List<String> list(String path) throws org.apache.hadoop.fs.PathNotFoundException, InvalidPathnameException, IOException
RegistryOperations
list
in interface RegistryOperations
path
- path to queryorg.apache.hadoop.fs.PathNotFoundException
InvalidPathnameException
IOException
public void delete(String path, boolean recursive) throws org.apache.hadoop.fs.PathNotFoundException, org.apache.hadoop.fs.PathIsNotEmptyDirectoryException, InvalidPathnameException, IOException
RegistryOperations
delete
in interface RegistryOperations
path
- path delete recursivelyrecursive
- recursive flagorg.apache.hadoop.fs.PathNotFoundException
- path is not in the registry.org.apache.hadoop.fs.PathIsNotEmptyDirectoryException
- path has child entries, but
recursive is false.InvalidPathnameException
- the path is invalid.IOException
- Any other IO Exceptionpublic boolean addWriteAccessor(String id, String pass) throws IOException
RegistryOperations
addWriteAccessor
in interface RegistryOperations
id
- ID to usepass
- passwordIOException
- on any failure to build the digestpublic void clearWriteAccessors()
RegistryOperations
RegistryOperations.addWriteAccessor(String, String)
are removed.clearWriteAccessors
in interface RegistryOperations
Copyright © 2008–2019 Apache Software Foundation. All rights reserved.