当前位置: 首页>>代码示例>>Java>>正文


Java RegistryConstants类代码示例

本文整理汇总了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));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:RegistryUtils.java

示例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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:RegistryUtils.java

示例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;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:AbstractZKRegistryTest.java

示例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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:TestSecureRMRegistryOperations.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-slider,代码行数:16,代码来源:YarnRegistryViewForProviders.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-slider,代码行数:20,代码来源:AbstractSliderLaunchedService.java

示例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);
  
}
 
开发者ID:apache,项目名称:incubator-slider,代码行数:13,代码来源:ConfigHelper.java

示例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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:TestRegistrySecurityHelper.java

示例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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:RegistryUtils.java

示例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);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:14,代码来源:RegistryUtils.java


注:本文中的org.apache.hadoop.registry.client.api.RegistryConstants类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。