本文整理汇总了Java中org.apache.hadoop.registry.client.api.RegistryConstants类的典型用法代码示例。如果您正苦于以下问题:Java RegistryConstants类的具体用法?Java RegistryConstants怎么用?Java RegistryConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RegistryConstants类属于org.apache.hadoop.registry.client.api包,在下文中一共展示了RegistryConstants类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: homePathForUser
import org.apache.hadoop.registry.client.api.RegistryConstants; //导入依赖的package包/类
/**
* Buld the user path -switches to the system path if the user is "".
* It also cross-converts the username to ascii via punycode
* @param username username or ""
* @return the path to the user
*/
public static String homePathForUser(String username) {
Preconditions.checkArgument(username != null, "null user");
// catch recursion
if (username.startsWith(RegistryConstants.PATH_USERS)) {
return username;
}
if (username.isEmpty()) {
return RegistryConstants.PATH_SYSTEM_SERVICES;
}
// convert username to registry name
String convertedName = convertUsername(username);
return RegistryPathUtils.join(RegistryConstants.PATH_USERS,
encodeForRegistry(convertedName));
}
示例2: serviceclassPath
import org.apache.hadoop.registry.client.api.RegistryConstants; //导入依赖的package包/类
/**
* Create a service classpath
* @param user username or ""
* @param serviceClass service name
* @return a full path
*/
public static String serviceclassPath(String user,
String serviceClass) {
String services = join(homePathForUser(user),
RegistryConstants.PATH_USER_SERVICES);
return join(services,
serviceClass);
}
示例3: createRegistryConfiguration
import org.apache.hadoop.registry.client.api.RegistryConstants; //导入依赖的package包/类
public YarnConfiguration createRegistryConfiguration() {
YarnConfiguration conf = new YarnConfiguration();
conf.setInt(RegistryConstants.KEY_REGISTRY_ZK_CONNECTION_TIMEOUT, 1000);
conf.setInt(RegistryConstants.KEY_REGISTRY_ZK_RETRY_INTERVAL, 500);
conf.setInt(RegistryConstants.KEY_REGISTRY_ZK_RETRY_TIMES, 10);
conf.setInt(RegistryConstants.KEY_REGISTRY_ZK_RETRY_CEILING, 10);
conf.set(RegistryConstants.KEY_REGISTRY_ZK_QUORUM,
zookeeper.getConnectionString());
return conf;
}
示例4: setupTestSecureRMRegistryOperations
import org.apache.hadoop.registry.client.api.RegistryConstants; //导入依赖的package包/类
@Before
public void setupTestSecureRMRegistryOperations() throws Exception {
startSecureZK();
secureConf = new Configuration();
secureConf.setBoolean(KEY_REGISTRY_SECURE, true);
// create client conf containing the ZK quorum
zkClientConf = new Configuration(secureZK.getConfig());
zkClientConf.setBoolean(KEY_REGISTRY_SECURE, true);
assertNotEmpty(zkClientConf.get(RegistryConstants.KEY_REGISTRY_ZK_QUORUM));
// ZK is in charge
secureConf.set(KEY_REGISTRY_SYSTEM_ACCOUNTS, "sasl:[email protected]");
zookeeperUGI = loginUGI(ZOOKEEPER, keytab_zk);
}
示例5: getAbsoluteSelfRegistrationPath
import org.apache.hadoop.registry.client.api.RegistryConstants; //导入依赖的package包/类
/**
* Get the absolute path to where the service has registered itself.
* This includes the base registry path
* Null until the service is registered
* @return the service registration path.
*/
public String getAbsoluteSelfRegistrationPath() {
if (selfRegistrationPath == null) {
return null;
}
String root = registryOperations.getConfig().getTrimmed(
RegistryConstants.KEY_REGISTRY_ZK_ROOT,
RegistryConstants.DEFAULT_ZK_REGISTRY_ROOT);
return RegistryPathUtils.join(root, selfRegistrationPath);
}
示例6: lookupZKQuorum
import org.apache.hadoop.registry.client.api.RegistryConstants; //导入依赖的package包/类
/**
* look up the registry quorum from the config
* @return the quorum string
* @throws BadConfigException if it is not there or invalid
*/
public String lookupZKQuorum() throws BadConfigException {
String registryQuorum = getConfig().get(RegistryConstants.KEY_REGISTRY_ZK_QUORUM);
// though if neither is set: trouble
if (SliderUtils.isUnset(registryQuorum)) {
throw new BadConfigException(
"No Zookeeper quorum provided in the"
+ " configuration property " + RegistryConstants.KEY_REGISTRY_ZK_QUORUM
);
}
ZookeeperUtils.splitToHostsAndPortsStrictly(registryQuorum);
return registryQuorum;
}
示例7: registerDeprecatedConfigItems
import org.apache.hadoop.registry.client.api.RegistryConstants; //导入依赖的package包/类
/**
* Register anything we consider deprecated
*/
public static void registerDeprecatedConfigItems() {
Configuration.addDeprecation(
SliderXmlConfKeys.REGISTRY_ZK_QUORUM,
RegistryConstants.KEY_REGISTRY_ZK_QUORUM);
Configuration.addDeprecation(
SliderXmlConfKeys.REGISTRY_PATH,
RegistryConstants.KEY_REGISTRY_ZK_ROOT);
}
示例8: testDefaultAClsValid
import org.apache.hadoop.registry.client.api.RegistryConstants; //导入依赖的package包/类
@Test
public void testDefaultAClsValid() throws Throwable {
registrySecurity.buildACLs(
RegistryConstants.DEFAULT_REGISTRY_SYSTEM_ACCOUNTS,
REALM_EXAMPLE_COM, ZooDefs.Perms.ALL);
}
示例9: componentListPath
import org.apache.hadoop.registry.client.api.RegistryConstants; //导入依赖的package包/类
/**
* Create a path for listing components under a service
* @param user username or ""
* @param serviceClass service name
* @param serviceName service name unique for that user and service class
* @return a full path
*/
public static String componentListPath(String user,
String serviceClass, String serviceName) {
return join(servicePath(user, serviceClass, serviceName),
RegistryConstants.SUBPATH_COMPONENTS);
}
示例10: componentListPath
import org.apache.hadoop.registry.client.api.RegistryConstants; //导入依赖的package包/类
/**
* Create a path for listing components under a service
* @param user username or ""
* @param serviceClass service name
* @param serviceName service name unique for that user & service class
* @return a full path
*/
public static String componentListPath(String user,
String serviceClass, String serviceName) {
return join(servicePath(user, serviceClass, serviceName),
RegistryConstants.SUBPATH_COMPONENTS);
}