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


Java HelixManager.getClusterManagmentTool方法代码示例

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


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

示例1: getInstanceToTopicPartitionsMap

import org.apache.helix.HelixManager; //导入方法依赖的package包/类
/**
 * From IdealStates.
 *
 * @return InstanceToNumTopicPartitionMap
 */
public static Map<String, Set<TopicPartition>> getInstanceToTopicPartitionsMap(
    HelixManager helixManager) {
  Map<String, Set<TopicPartition>> instanceToNumTopicPartitionMap =
      new HashMap<String, Set<TopicPartition>>();
  HelixAdmin helixAdmin = helixManager.getClusterManagmentTool();
  String helixClusterName = helixManager.getClusterName();
  for (String topic : helixAdmin.getResourcesInCluster(helixClusterName)) {
    IdealState is = helixAdmin.getResourceIdealState(helixClusterName, topic);
    for (String partition : is.getPartitionSet()) {
      TopicPartition tpi = new TopicPartition(topic, Integer.parseInt(partition));
      for (String instance : is.getInstanceSet(partition)) {
        if (!instanceToNumTopicPartitionMap.containsKey(instance)) {
          instanceToNumTopicPartitionMap.put(instance, new HashSet<TopicPartition>());
        }
        instanceToNumTopicPartitionMap.get(instance).add(tpi);
      }
    }
  }
  return instanceToNumTopicPartitionMap;
}
 
开发者ID:uber,项目名称:uReplicator,代码行数:26,代码来源:HelixUtils.java

示例2: getUnassignedPartitions

import org.apache.helix.HelixManager; //导入方法依赖的package包/类
public static Set<TopicPartition> getUnassignedPartitions(HelixManager helixManager) {
  Set<TopicPartition> unassignedPartitions = new HashSet<TopicPartition>();
  HelixAdmin helixAdmin = helixManager.getClusterManagmentTool();
  String helixClusterName = helixManager.getClusterName();
  for (String topic : helixAdmin.getResourcesInCluster(helixClusterName)) {
    IdealState is = helixAdmin.getResourceIdealState(helixClusterName, topic);
    int numPartitions = is.getNumPartitions();
    for (int partition = 0; partition < numPartitions; ++partition) {
      if (is.getInstanceSet(Integer.toString(partition)).isEmpty()) {
        TopicPartition tpi = new TopicPartition(topic, partition);
        unassignedPartitions.add(tpi);
      }
    }
  }
  return unassignedPartitions;
}
 
开发者ID:uber,项目名称:uReplicator,代码行数:17,代码来源:HelixUtils.java

示例3: getInstanceToTopicPartitionsMap

import org.apache.helix.HelixManager; //导入方法依赖的package包/类
/**
 * From IdealStates.
 * @param helixManager
 * @return InstanceToNumTopicPartitionMap
 */
public static Map<String, Set<TopicPartition>> getInstanceToTopicPartitionsMap(
    HelixManager helixManager) {
  Map<String, Set<TopicPartition>> instanceToNumTopicPartitionMap =
      new HashMap<String, Set<TopicPartition>>();
  HelixAdmin helixAdmin = helixManager.getClusterManagmentTool();
  String helixClusterName = helixManager.getClusterName();
  for (String topic : helixAdmin.getResourcesInCluster(helixClusterName)) {
    IdealState is = helixAdmin.getResourceIdealState(helixClusterName, topic);
    for (String partition : is.getPartitionSet()) {
      TopicPartition tpi = new TopicPartition(topic, Integer.parseInt(partition));
      for (String instance : is.getInstanceSet(partition)) {
        if (!instanceToNumTopicPartitionMap.containsKey(instance)) {
          instanceToNumTopicPartitionMap.put(instance, new HashSet<TopicPartition>());
        }
        instanceToNumTopicPartitionMap.get(instance).add(tpi);
      }
    }
  }
  return instanceToNumTopicPartitionMap;
}
 
开发者ID:uber,项目名称:chaperone,代码行数:26,代码来源:HelixUtils.java

示例4: ParticipantManager

import org.apache.helix.HelixManager; //导入方法依赖的package包/类
public ParticipantManager(HelixManager manager, ZkClient zkclient, int sessionTimeout,
    LiveInstanceInfoProvider liveInstanceInfoProvider, List<PreConnectCallback> preConnectCallbacks) {
  _zkclient = zkclient;
  _manager = manager;
  _clusterName = manager.getClusterName();
  _instanceName = manager.getInstanceName();
  _keyBuilder = new PropertyKey.Builder(_clusterName);
  _sessionId = manager.getSessionId();
  _sessionTimeout = sessionTimeout;
  _configAccessor = manager.getConfigAccessor();
  _instanceType = manager.getInstanceType();
  _helixAdmin = manager.getClusterManagmentTool();
  _dataAccessor = (ZKHelixDataAccessor) manager.getHelixDataAccessor();
  _messagingService = (DefaultMessagingService) manager.getMessagingService();
  _stateMachineEngine = manager.getStateMachineEngine();
  _liveInstanceInfoProvider = liveInstanceInfoProvider;
  _preConnectCallbacks = preConnectCallbacks;
}
 
开发者ID:apache,项目名称:helix,代码行数:19,代码来源:ParticipantManager.java

示例5: assignIdealStates

import org.apache.helix.HelixManager; //导入方法依赖的package包/类
private static void assignIdealStates(HelixManager helixManager,
    Map<String, IdealState> idealStatesFromAssignment) {
  HelixAdmin helixAdmin = helixManager.getClusterManagmentTool();
  String helixClusterName = helixManager.getClusterName();
  for (String topic : idealStatesFromAssignment.keySet()) {
    IdealState idealState = idealStatesFromAssignment.get(topic);
    helixAdmin.setResourceIdealState(helixClusterName, topic, idealState);
  }
}
 
开发者ID:uber,项目名称:uReplicator,代码行数:10,代码来源:AutoRebalanceLiveInstanceChangeListener.java

示例6: BrokerResourceOnlineOfflineStateModelFactory

import org.apache.helix.HelixManager; //导入方法依赖的package包/类
public BrokerResourceOnlineOfflineStateModelFactory(HelixManager helixManager,
    ZkHelixPropertyStore<ZNRecord> propertyStore, HelixExternalViewBasedRouting helixExternalViewBasedRouting) {
  _helixManager = helixManager;
  _propertyStore = propertyStore;
  _helixAdmin = helixManager.getClusterManagmentTool();
  _helixExternalViewBasedRouting = helixExternalViewBasedRouting;
}
 
开发者ID:linkedin,项目名称:pinot,代码行数:8,代码来源:BrokerResourceOnlineOfflineStateModelFactory.java

示例7: RealtimeResourceStateTransitionHandler

import org.apache.helix.HelixManager; //导入方法依赖的package包/类
public RealtimeResourceStateTransitionHandler(HelixManager manager) {
  this.manager = manager;
  helixAdmin = manager.getClusterManagmentTool();
  realtimeSegmentManagerMap = new HashMap<String, KafkaRealtimeSegmentDataManager>();
}
 
开发者ID:Hanmourang,项目名称:Pinot,代码行数:6,代码来源:RealtimeResourceStateTransitionHandler.java

示例8: GobblinHelixTaskDriver

import org.apache.helix.HelixManager; //导入方法依赖的package包/类
public GobblinHelixTaskDriver(HelixManager manager) {
  this(manager.getClusterManagmentTool(), manager.getHelixDataAccessor(), manager
      .getConfigAccessor(), manager.getHelixPropertyStore(), manager.getClusterName());
}
 
开发者ID:apache,项目名称:incubator-gobblin,代码行数:5,代码来源:GobblinHelixTaskDriver.java


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