gpt4 book ai didi

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

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

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

ZKHelixAdmin.getResourceIdealState介绍

暂无

代码示例

代码示例来源:origin: apache/incubator-pinot

/**
 * return true if IdealState = ExternalView
 * @return
 */
public int isStable(String tableName) {
 IdealState idealState = helixAdmin.getResourceIdealState(clusterName, tableName);
 ExternalView externalView = helixAdmin.getResourceExternalView(clusterName, tableName);
 Map<String, Map<String, String>> mapFieldsIS = idealState.getRecord().getMapFields();
 Map<String, Map<String, String>> mapFieldsEV = externalView.getRecord().getMapFields();
 int numDiff = 0;
 for (String segment : mapFieldsIS.keySet()) {
  Map<String, String> mapIS = mapFieldsIS.get(segment);
  Map<String, String> mapEV = mapFieldsEV.get(segment);
  for (String server : mapIS.keySet()) {
   String state = mapIS.get(server);
   if (mapEV == null || mapEV.get(server) == null || !mapEV.get(server).equals(state)) {
    LOGGER.info(
      "Mismatch: segment " + segment + " server:" + server + " expected state:" + state + " actual state:" + (
        (mapEV == null || mapEV.get(server) == null) ? "null" : mapEV.get(server)));
    numDiff = numDiff + 1;
   }
  }
 }
 return numDiff;
}

代码示例来源:origin: apache/incubator-pinot

public void fixTableIdealState(String tableName)
  throws Exception {
 IdealState idealState = _helixAdmin.getResourceIdealState(_clusterName, tableName);
 if (idealState == null) {
  LOGGER.info("No IDEALSTATE found for table " + tableName);

代码示例来源:origin: apache/incubator-pinot

/**
 * return true if IdealState = ExternalView
 * @return
 */
public int isStable(String tableName) {
 IdealState idealState = helixAdmin.getResourceIdealState(clusterName, tableName);
 ExternalView externalView = helixAdmin.getResourceExternalView(clusterName, tableName);
 Map<String, Map<String, String>> mapFieldsIS = idealState.getRecord().getMapFields();
 Map<String, Map<String, String>> mapFieldsEV = externalView.getRecord().getMapFields();
 int numDiff = 0;
 for (String segment : mapFieldsIS.keySet()) {
  Map<String, String> mapIS = mapFieldsIS.get(segment);
  Map<String, String> mapEV = mapFieldsEV.get(segment);
  for (String server : mapIS.keySet()) {
   String state = mapIS.get(server);
   if (mapEV == null || mapEV.get(server) == null || !mapEV.get(server).equals(state)) {
    LOGGER.info("Mismatch: segment" + segment + " server:" + server + " state:" + state);
    numDiff = numDiff + 1;
   }
  }
 }
 return numDiff;
}

代码示例来源:origin: apache/incubator-pinot

IdealState resourceIdealState = helixAdmin.getResourceIdealState(clusterName, resourceName);
ExternalView resourceExternalView = helixAdmin.getResourceExternalView(clusterName, resourceName);
Map<String, Map<String, String>> mapFieldsFromIS = resourceIdealState.getRecord().getMapFields();

代码示例来源:origin: apache/incubator-pinot

IdealState currentIdealState = helixAdmin.getResourceIdealState(clusterName, offlineTableName);
int currentNumReplicas = Integer.parseInt(currentIdealState.getReplicas());

代码示例来源:origin: apache/incubator-pinot

helix.getResourceIdealState(zkPath, tableName).getRecord().getMapFields();

代码示例来源:origin: apache/incubator-pinot

return;
IdealState currentIdealState = helixAdmin.getResourceIdealState(clusterName, tableName);
List<String> partitions = Lists.newArrayList(currentIdealState.getPartitionSet());
LinkedHashMap<String, Integer> states = new LinkedHashMap<>();

代码示例来源:origin: apache/incubator-pinot

IdealState idealState = zkHelixAdmin.getResourceIdealState(_clusterName, table);
ExternalView externalView = zkHelixAdmin.getResourceExternalView(_clusterName, table);
Set<String> segmentsFromIdealState = idealState.getPartitionSet();

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

@Override
public void enableBatchMessageMode(String clusterName, String resourceName, boolean enabled) {
 logger.info("{} batch message mode for resource {} in cluster {}.",
   enabled ? "Enable" : "Disable", resourceName, clusterName);
 // TODO: Change IdealState to ResourceConfig when configs are migrated to ResourceConfig
 IdealState idealState = getResourceIdealState(clusterName, resourceName);
 if (idealState == null) {
  throw new HelixException("Cluster " + clusterName + ", resource: " + resourceName
    + ", ideal-state does not exist");
 }
 idealState.setBatchMessageMode(enabled);
 setResourceIdealState(clusterName, resourceName, idealState);
}

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

@Override
public void enableBatchMessageMode(String clusterName, String resourceName,
  boolean enabled) {
 logger.info("{} batch message mode for resource {} in cluster {}.",
   enabled ? "Enable" : "Disable", resourceName, clusterName);
 // TODO: Change IdealState to ResourceConfig when configs are migrated to ResourceConfig
 IdealState idealState = getResourceIdealState(clusterName, resourceName);
 if (idealState == null) {
  throw new HelixException("Cluster " + clusterName + ", resource: " + resourceName
    + ", ideal-state does not exist");
 }
 idealState.setBatchMessageMode(enabled);
 setResourceIdealState(clusterName, resourceName, idealState);
}

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

IdealState idealState = getResourceIdealState(clusterName, resourceName);
if (idealState == null) {
 throw new HelixException("Resource: " + resourceName + " has NOT been added yet");

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

IdealState idealState = getResourceIdealState(clusterName, resourceName);
if (idealState == null) {
 throw new HelixException("Resource: " + resourceName + " has NOT been added yet");

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

IdealState idealState = _admin.getResourceIdealState(CLUSTER_NAME, TEST_DB2);
idealState.setDisableExternalView(true);
_admin.setResourceIdealState(CLUSTER_NAME, TEST_DB2, idealState);

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

IdealState.RebalanceMode.FULL_AUTO + "");
IdealState idealState = _admin.getResourceIdealState(CLUSTER_NAME, TEST_DB1);
idealState.setDisableExternalView(true);
_admin.setResourceIdealState(CLUSTER_NAME, TEST_DB1, idealState);

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