gpt4 book ai didi

org.apache.helix.manager.zk.ZKHelixAdmin.rebalance()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 02:08:49 26 4
gpt4 key购买 nike

本文整理了Java中org.apache.helix.manager.zk.ZKHelixAdmin.rebalance()方法的一些代码示例,展示了ZKHelixAdmin.rebalance()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKHelixAdmin.rebalance()方法的具体详情如下:
包路径:org.apache.helix.manager.zk.ZKHelixAdmin
类名称:ZKHelixAdmin
方法名:rebalance

ZKHelixAdmin.rebalance介绍

[英]Takes the existing idealstate as input and computes newIdealState such that the partition movement is minimized. The partitions are redistributed among the instances provided.
[中]将现有的idealstate作为输入,并计算新的idealstate,以使分区移动最小化。分区将在提供的实例中重新分配。

代码示例

代码示例来源:origin: apache/helix

@Override
public void rebalance(String clusterName, String resourceName, int replica,
  List<String> instances) {
 rebalance(clusterName, resourceName, replica, resourceName, instances, "");
}

代码示例来源:origin: org.apache.helix/helix-core

@Override
public void rebalance(String clusterName, String resourceName, int replica,
  List<String> instances) {
 rebalance(clusterName, resourceName, replica, resourceName, instances, "");
}

代码示例来源:origin: apache/helix

@Override
public void rebalance(String clusterName, String resourceName, int replica) {
 rebalance(clusterName, resourceName, replica, resourceName, "");
}

代码示例来源:origin: org.apache.helix/helix-core

@Override
public void rebalance(String clusterName, String resourceName, int replica) {
 rebalance(clusterName, resourceName, replica, resourceName, "");
}

代码示例来源:origin: apache/helix

@Override
public void rebalance(String clusterName, String resourceName, int replica, String keyPrefix,
  String group) {
 List<String> instanceNames = new LinkedList<String>();
 if (keyPrefix == null || keyPrefix.length() == 0) {
  keyPrefix = resourceName;
 }
 if (group != null && group.length() > 0) {
  instanceNames = getInstancesInClusterWithTag(clusterName, group);
 }
 if (instanceNames.size() == 0) {
  logger.info("No tags found for resource " + resourceName + ", use all instances");
  instanceNames = getInstancesInCluster(clusterName);
  group = "";
 } else {
  logger.info("Found instances with tag for " + resourceName + " " + instanceNames);
 }
 rebalance(clusterName, resourceName, replica, keyPrefix, instanceNames, group);
}

代码示例来源:origin: org.apache.helix/helix-core

@Override
public void rebalance(String clusterName, String resourceName, int replica,
  String keyPrefix, String group) {
 List<String> instanceNames = new LinkedList<String>();
 if (keyPrefix == null || keyPrefix.length() == 0) {
  keyPrefix = resourceName;
 }
 if (group != null && group.length() > 0) {
  instanceNames = getInstancesInClusterWithTag(clusterName, group);
 }
 if (instanceNames.size() == 0) {
  logger.info("No tags found for resource " + resourceName + ", use all instances");
  instanceNames = getInstancesInCluster(clusterName);
  group = "";
 } else {
  logger.info("Found instances with tag for " + resourceName + " " + instanceNames);
 }
 rebalance(clusterName, resourceName, replica, keyPrefix, instanceNames, group);
}

代码示例来源:origin: org.apache.helix/helix-core

admin.rebalance(clusterName, resourceName, 3);
} else if (idealStateRebalancerMode == RebalanceMode.CUSTOMIZED) {
 admin.addIdealState(clusterName, resourceName, idealStateJsonFile);

代码示例来源:origin: apache/helix

admin.rebalance(clusterName, resourceName, 3);
} else if (idealStateRebalancerMode == RebalanceMode.CUSTOMIZED) {
 admin.addIdealState(clusterName, resourceName, idealStateJsonFile);

代码示例来源:origin: apache/helix

RebalanceMode.FULL_AUTO.toString());
admin.rebalance(clusterName, resourceName, 1);

代码示例来源:origin: apache/helix

admin.addResource(clusterName, resourceName, DEFAULT_PARTITION_NUMBER, DEFAULT_STATE_MODEL,
  RebalanceMode.SEMI_AUTO.toString());
admin.rebalance(clusterName, resourceName, 1);

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com