java.io.Closeable, java.lang.AutoCloseable, RegistryConstants, RegistryOperations, RegistryBindingSource, org.apache.hadoop.service.Servicepublic class RegistryAdminService extends RegistryOperationsService
submit(Callable) will be
run asynchronously. The createDirAsync(String, List, boolean)
is an example of such an an action
A key async action is the depth-first tree purge, which supports
pluggable policies for deleting entries. The method
purge(String, NodeSelector, PurgePolicy, BackgroundCallback)
implements the recursive purge operation —the class
{{AsyncPurge}} provides the asynchronous scheduling of this.| Modifier and Type | Class | Description |
|---|---|---|
class |
RegistryAdminService.AsyncPurge |
An async registry purge action taking
a selector which decides what to delete
|
static interface |
RegistryAdminService.NodeSelector |
Comparator used for purge logic
|
static class |
RegistryAdminService.PurgePolicy |
Policy to purge entries
|
| Modifier and Type | Field | Description |
|---|---|---|
protected java.util.concurrent.ExecutorService |
executor |
Executor for async operations
|
static int |
USER_HOMEDIR_ACL_PERMISSIONS |
The ACL permissions for the user's homedir ACL.
|
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 | Description |
|---|---|
RegistryAdminService(java.lang.String name) |
Construct an instance of the service
|
RegistryAdminService(java.lang.String name,
RegistryBindingSource bindingSource) |
construct an instance of the service, using the
specified binding source to bond to ZK
|
| Modifier and Type | Method | Description |
|---|---|---|
java.util.List<org.apache.zookeeper.data.ACL> |
aclsForUser(java.lang.String username,
int perms) |
Set up the ACL for the user.
|
java.util.concurrent.Future<java.lang.Boolean> |
createDirAsync(java.lang.String path,
java.util.List<org.apache.zookeeper.data.ACL> acls,
boolean createParents) |
Asynchronous operation to create a directory
|
void |
createRootRegistryPaths() |
Create the initial registry paths
|
protected java.util.concurrent.ExecutorService |
getExecutor() |
Get the executor
|
protected java.lang.String |
homeDir(java.lang.String username) |
Get the path to a user's home dir
|
java.lang.String |
initUserRegistry(java.lang.String username) |
Create the home path for a user if it does not exist.
|
java.util.concurrent.Future<java.lang.Boolean> |
initUserRegistryAsync(java.lang.String shortname) |
Start an async operation to create the home path for a user
if it does not exist
|
int |
purge(java.lang.String path,
RegistryAdminService.NodeSelector selector,
RegistryAdminService.PurgePolicy purgePolicy,
org.apache.curator.framework.api.BackgroundCallback callback) |
Recursive operation to purge all matching records under a base path.
|
protected void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
Init operation sets up the system ACLs.
|
protected void |
serviceStart() |
Start the service, including creating base directories with permissions
|
protected void |
serviceStop() |
Stop the service: halt the executor.
|
protected void |
stopExecutor() |
Stop the executor if it is not null.
|
<V> java.util.concurrent.Future<V> |
submit(java.util.concurrent.Callable<V> callable) |
Submit a callable
|
protected void |
verifyRealmValidity() |
Method to validate the validity of the kerberos realm.
|
bind, delete, exists, getClientAcls, list, mknode, resolve, stat, validatePathaddWriteAccessor, bindingDiagnosticDetails, buildConnectionString, buildSecurityDiagnostics, clearWriteAccessors, createEnsembleProvider, createFullPath, dumpPath, dumpRegistryRobustly, getBindingSource, getRegistrySecurity, instantiateCacheForRegistry, isSecure, maybeCreate, operationFailure, operationFailure, registerPathListener, setKerberosPrincipalAndKeytab, startCache, supplyBindingInformation, toString, zkCreate, zkDelete, zkGetACLS, zkList, zkMkParentPath, zkMkPath, zkPathExists, zkPathMustExist, zkRead, zkSet, zkStat, zkUpdateaddIfService, addService, getServices, removeServiceclose, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddWriteAccessor, clearWriteAccessorspublic static final int USER_HOMEDIR_ACL_PERMISSIONS
protected final java.util.concurrent.ExecutorService executor
public RegistryAdminService(java.lang.String name)
name - service namepublic RegistryAdminService(java.lang.String name,
RegistryBindingSource bindingSource)
name - service namebindingSource - provider of ZK binding informationprotected void serviceStop()
throws java.lang.Exception
serviceStop in class CuratorServicejava.lang.Exception - exception.protected void stopExecutor()
ExecutorService.shutdownNow()
and so does not block until they have completed.protected java.util.concurrent.ExecutorService getExecutor()
public <V> java.util.concurrent.Future<V> submit(java.util.concurrent.Callable<V> callable)
V - type of the final getcallable - callablepublic java.util.concurrent.Future<java.lang.Boolean> createDirAsync(java.lang.String path,
java.util.List<org.apache.zookeeper.data.ACL> acls,
boolean createParents)
throws java.io.IOException
path - pathacls - ACL listcreateParents - flag to indicate parent dirs should be created
as neededjava.io.IOExceptionprotected void serviceInit(org.apache.hadoop.conf.Configuration conf)
throws java.lang.Exception
serviceInit in class CuratorServiceconf - configuration of the servicejava.lang.Exceptionprotected void serviceStart()
throws java.lang.Exception
serviceStart in class CuratorServicejava.lang.Exception@VisibleForTesting
public void createRootRegistryPaths()
throws java.io.IOException
java.io.IOException - any failureprotected java.lang.String homeDir(java.lang.String username)
username - usernamepublic java.util.List<org.apache.zookeeper.data.ACL> aclsForUser(java.lang.String username,
int perms)
throws java.io.IOException
username - user nameperms - permissionsjava.io.IOException - ACL creation/parsing problemspublic java.util.concurrent.Future<java.lang.Boolean> initUserRegistryAsync(java.lang.String shortname)
throws java.io.IOException
shortname - username, without any @REALM in kerberosjava.io.IOException - any failure while setting up the operationpublic java.lang.String initUserRegistry(java.lang.String username)
throws java.io.IOException
initUserRegistryAsync(String) and then waits for the
result ... the code path is the same as the async operation; this just
picks up and relays/converts exceptionsusername - usernamejava.io.IOException - any failureprotected void verifyRealmValidity()
throws org.apache.hadoop.service.ServiceStateException
org.apache.hadoop.service.ServiceStateException@VisibleForTesting
public int purge(java.lang.String path,
RegistryAdminService.NodeSelector selector,
RegistryAdminService.PurgePolicy purgePolicy,
org.apache.curator.framework.api.BackgroundCallback callback)
throws java.io.IOException
path - base pathselector - selector for the purge policypurgePolicy - what to do if there is a matching record with childrencallback - optional curator callbackjava.io.IOException - problemsorg.apache.hadoop.fs.PathIsNotEmptyDirectoryException - if an entry cannot be deleted
as it has children and the purge policy is FailOnChildrenCopyright © 2008–2025 Apache Software Foundation. All rights reserved.