public abstract class ZkRegistryBase<InstanceType extends ServiceInstance> extends Object
Modifier and Type | Field and Description |
---|---|
protected org.apache.hadoop.conf.Configuration |
conf |
protected boolean |
doCheckAcls |
protected org.apache.hadoop.registry.client.binding.RegistryUtils.ServiceRecordMarshal |
encoder |
protected static String |
hostname
Local hostname.
|
protected static UUID |
UNIQUE_ID |
static String |
UNIQUE_IDENTIFIER |
protected static String |
USER_SCOPE_PATH_PREFIX |
protected static String |
WORKER_GROUP |
protected static String |
WORKER_PREFIX |
protected String |
workersPath |
protected org.apache.curator.framework.CuratorFramework |
zooKeeperClient |
Constructor and Description |
---|
ZkRegistryBase(String instanceName,
org.apache.hadoop.conf.Configuration conf,
String rootNs,
String nsPrefix,
String userScopePathPrefix,
String workerPrefix,
String workerGroup,
String zkSaslLoginContextName,
String zkPrincipal,
String zkKeytab,
HiveConf.ConfVars aclsConfig) |
Modifier and Type | Method and Description |
---|---|
protected abstract InstanceType |
createServiceInstance(org.apache.hadoop.registry.client.types.ServiceRecord srv) |
protected org.apache.curator.framework.recipes.cache.PathChildrenCache |
ensureInstancesCache(long clusterReadyTimeoutMs) |
protected Collection<InstanceType> |
getAllInternal() |
protected Set<InstanceType> |
getByHostInternal(String host) |
protected InstanceType |
getInstanceByPath(String path) |
protected String |
getRegistrationZnodePath() |
static String |
getRootNamespace(String userProvidedNamespace,
String defaultNamespacePrefix) |
protected static byte[] |
getWorkerData(org.apache.curator.framework.recipes.cache.ChildData childData,
String workerNodePrefix) |
protected abstract String |
getZkPathUser(org.apache.hadoop.conf.Configuration conf) |
protected void |
populateCache(org.apache.curator.framework.recipes.cache.PathChildrenCache instancesCache,
boolean doInvokeListeners) |
protected String |
registerServiceRecord(org.apache.hadoop.registry.client.types.ServiceRecord srv) |
protected String |
registerServiceRecord(org.apache.hadoop.registry.client.types.ServiceRecord srv,
String uniqueId) |
void |
registerStateChangeListener(ServiceInstanceStateChangeListener<InstanceType> listener) |
protected int |
sizeInternal() |
void |
start() |
void |
stop() |
protected void |
unregisterInternal() |
protected void |
updateServiceRecord(org.apache.hadoop.registry.client.types.ServiceRecord srv,
boolean doCheckAcls,
boolean closeOnFailure) |
protected static final String USER_SCOPE_PATH_PREFIX
protected static final String WORKER_PREFIX
protected static final String WORKER_GROUP
public static final String UNIQUE_IDENTIFIER
protected static final UUID UNIQUE_ID
protected final org.apache.hadoop.conf.Configuration conf
protected final org.apache.curator.framework.CuratorFramework zooKeeperClient
protected final String workersPath
protected final org.apache.hadoop.registry.client.binding.RegistryUtils.ServiceRecordMarshal encoder
protected final boolean doCheckAcls
protected static final String hostname
public ZkRegistryBase(String instanceName, org.apache.hadoop.conf.Configuration conf, String rootNs, String nsPrefix, String userScopePathPrefix, String workerPrefix, String workerGroup, String zkSaslLoginContextName, String zkPrincipal, String zkKeytab, HiveConf.ConfVars aclsConfig)
rootNs
- A single root namespace override. Not recommended.nsPrefix
- The namespace prefix to use with default namespaces (appends 'sasl' for secure else 'unsecure'
to namespace prefix to get effective root namespace).userScopePathPrefix
- The prefix to use for the user-specific part of the path.workerPrefix
- The prefix to use for each worker znode.workerGroup
- group name to use for all workerszkSaslLoginContextName
- SASL login context name for ZK security; null if not needed.zkPrincipal
- ZK security principal.zkKeytab
- ZK security keytab.aclsConfig
- A config setting to use to determine if ACLs should be verified.public static String getRootNamespace(String userProvidedNamespace, String defaultNamespacePrefix)
protected abstract String getZkPathUser(org.apache.hadoop.conf.Configuration conf)
protected final String registerServiceRecord(org.apache.hadoop.registry.client.types.ServiceRecord srv) throws IOException
IOException
protected final String registerServiceRecord(org.apache.hadoop.registry.client.types.ServiceRecord srv, String uniqueId) throws IOException
IOException
protected final void updateServiceRecord(org.apache.hadoop.registry.client.types.ServiceRecord srv, boolean doCheckAcls, boolean closeOnFailure) throws IOException
IOException
protected final void populateCache(org.apache.curator.framework.recipes.cache.PathChildrenCache instancesCache, boolean doInvokeListeners)
protected abstract InstanceType createServiceInstance(org.apache.hadoop.registry.client.types.ServiceRecord srv) throws IOException
IOException
protected static byte[] getWorkerData(org.apache.curator.framework.recipes.cache.ChildData childData, String workerNodePrefix)
protected final int sizeInternal()
protected final Set<InstanceType> getByHostInternal(String host)
protected final Collection<InstanceType> getAllInternal()
public void registerStateChangeListener(ServiceInstanceStateChangeListener<InstanceType> listener) throws IOException
IOException
protected final org.apache.curator.framework.recipes.cache.PathChildrenCache ensureInstancesCache(long clusterReadyTimeoutMs) throws IOException
IOException
public void start() throws IOException
IOException
protected void unregisterInternal()
public void stop()
protected final InstanceType getInstanceByPath(String path)
protected final String getRegistrationZnodePath()
Copyright © 2022 The Apache Software Foundation. All rights reserved.