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


Java RegistryUtils.componentPath方法代码示例

本文整理汇总了Java中org.apache.hadoop.registry.client.binding.RegistryUtils.componentPath方法的典型用法代码示例。如果您正苦于以下问题:Java RegistryUtils.componentPath方法的具体用法?Java RegistryUtils.componentPath怎么用?Java RegistryUtils.componentPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.registry.client.binding.RegistryUtils的用法示例。


在下文中一共展示了RegistryUtils.componentPath方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: needUpgrade

import org.apache.hadoop.registry.client.binding.RegistryUtils; //导入方法依赖的package包/类
public boolean needUpgrade() {
    String containerPath = RegistryUtils.componentPath(
            JOYConstants.APP_TYPE, this.executorMeta.getInstanceName(),
            this.executorMeta.getApplicationId(), this.executorMeta.getRunningContainer());

    try {
        if (registryOperations.exists(containerPath)) {
            ServiceRecord sr = registryOperations.resolve(containerPath);
            if (sr.get(JOYConstants.NEED_UPGRADE) != null && sr.get(JOYConstants.NEED_UPGRADE).equals(JOYConstants.TRUE)) {
                sr.set(JOYConstants.NEED_UPGRADE, JOYConstants.FALSE);
                registryOperations.bind(containerPath, sr, BindFlags.OVERWRITE);
                LOG.info(JOYConstants.NEED_UPGRADE);
                return true;
            }
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    return false;
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:21,代码来源:Executor.java

示例2: deleteContainer

import org.apache.hadoop.registry.client.binding.RegistryUtils; //导入方法依赖的package包/类
public void deleteContainer(String containerIdAsName) {
  try {
    String path = RegistryUtils.componentPath(user, serviceClass, appIdAsName, containerIdAsName);
    boolean exists = registryOperations.exists(path);
    if (exists) {
      registryOperations.delete(path, false);
    } else {
      LOG.info(path + " cannot be found");
    }
  } catch (IOException e) {
    e.printStackTrace();
  }

}
 
开发者ID:intel-hadoop,项目名称:yacop,代码行数:15,代码来源:NRegistryOperator.java

示例3: resolveContainer

import org.apache.hadoop.registry.client.binding.RegistryUtils; //导入方法依赖的package包/类
public ServiceRecord resolveContainer(String containerIdAsName) throws IOException {
  String path = RegistryUtils.componentPath(user, serviceClass, appIdAsName, containerIdAsName);
  boolean exists = registryOperations.exists(path);
  if (exists) {
    ServiceRecord record = registryOperations.resolve(path);
    return record;
  } else {
    LOG.info(path + " cannot be found");
    return null;
  }
}
 
开发者ID:intel-hadoop,项目名称:yacop,代码行数:12,代码来源:NRegistryOperator.java

示例4: resolveContainers

import org.apache.hadoop.registry.client.binding.RegistryUtils; //导入方法依赖的package包/类
public Map<String, ServiceRecord> resolveContainers() throws IOException {
  Map<String, ServiceRecord> records = new HashMap<String, ServiceRecord>();

  List<String> containerIds = listAllContainers();
  if (containerIds.isEmpty()) {
    return null;
  }

  for (String containerId : containerIds) {
    String path = RegistryUtils.componentPath(user, serviceClass, appIdAsName, containerId);
    ServiceRecord record = registryOperations.resolve(path);
    records.put(containerId, record);
  }
  return records;
}
 
开发者ID:intel-hadoop,项目名称:yacop,代码行数:16,代码来源:NRegistryOperator.java

示例5: putComponent

import org.apache.hadoop.registry.client.binding.RegistryUtils; //导入方法依赖的package包/类
/**
 * Add a component 
 * @param serviceClass service class to use under ~user
 * @param componentName component name
 * @param record record to put
 * @throws IOException
 */
public void putComponent(String serviceClass,
    String serviceName,
    String componentName,
    ServiceRecord record) throws IOException {
  String path = RegistryUtils.componentPath(
      user, serviceClass, serviceName, componentName);
  registryOperations.mknode(RegistryPathUtils.parentOf(path), true);
  registryOperations.bind(path, record, BindFlags.OVERWRITE);
}
 
开发者ID:apache,项目名称:incubator-slider,代码行数:17,代码来源:YarnRegistryViewForProviders.java

示例6: deleteComponent

import org.apache.hadoop.registry.client.binding.RegistryUtils; //导入方法依赖的package包/类
/**
 * Delete a component
 * @param componentName component name
 * @throws IOException
 */
public void deleteComponent(String componentName) throws IOException {
  String path = RegistryUtils.componentPath(
      user, sliderServiceClass, instanceName,
      componentName);
  registryOperations.delete(path, false);
}
 
开发者ID:apache,项目名称:incubator-slider,代码行数:12,代码来源:YarnRegistryViewForProviders.java

示例7: deleteComponent

import org.apache.hadoop.registry.client.binding.RegistryUtils; //导入方法依赖的package包/类
/**
 * Delete a component
 * @param componentName component name
 * @throws IOException
 */
public void deleteComponent(String componentName) throws IOException {
  String path = RegistryUtils.componentPath(
      user, jstormServiceClass, instanceName,
      componentName);
  registryOperations.delete(path, false);
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:12,代码来源:YarnRegistryViewForProviders.java

示例8: putComponent

import org.apache.hadoop.registry.client.binding.RegistryUtils; //导入方法依赖的package包/类
private void putComponent(String containerIdAsName) throws IOException {
  String path = RegistryUtils.componentPath(user, serviceClass, appIdAsName, containerIdAsName);
  registryOperations.mknode(RegistryPathUtils.parentOf(path), true);
  registryOperations.bind(path, containerRecords.get(containerIdAsName), BindFlags.OVERWRITE);
}
 
开发者ID:intel-hadoop,项目名称:yacop,代码行数:6,代码来源:NRegistryOperator.java


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