gpt4 book ai didi

org.apache.helix.ZNRecord.getListField()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 06:04:40 27 4
gpt4 key购买 nike

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

ZNRecord.getListField介绍

[英]Get a single List field
[中]获取单个列表字段

代码示例

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

serverInfo.state = (liveInstances.contains(server)) ? "ONLINE" : "OFFLINE";
InstanceConfig config = zkHelixAdmin.getInstanceConfig(_clusterName, server);
serverInfo.tags = config.getRecord().getListField("TAG_LIST");
clusterInfo.addServerInfo(serverInfo);
brokerInfo.state = (liveInstances.contains(server)) ? "ONLINE" : "OFFLINE";
InstanceConfig config = zkHelixAdmin.getInstanceConfig(_clusterName, server);
brokerInfo.tags = config.getRecord().getListField("TAG_LIST");
clusterInfo.addBrokerInfo(brokerInfo);

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

private static List<String> getListValue(ZNRecord record, String key) {
 if (record == null) {
  return null;
 }
 return record.getListField(key);
}

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

/**
 * Get the preference list of a partition
 * @param partitionName the name of the partition
 * @return a list of instances that can serve replicas of the partition
 */
public List<String> getPreferenceList(String partitionName) {
 List<String> instanceStateList = _record.getListField(partitionName);
 if (instanceStateList != null) {
  return instanceStateList;
 }
 return null;
}

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

private static List<String> getListValue(ZNRecord record, String key) {
 if (record == null) {
  return null;
 }
 return record.getListField(key);
}

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

/**
 * Get the preference list of a partition
 * @param partitionName the name of the partition
 * @return a list of instances that can serve replicas of the partition
 */
public List<String> getPreferenceList(String partitionName) {
 List<String> instanceStateList = _record.getListField(partitionName);
 if (instanceStateList != null) {
  return instanceStateList;
 }
 return null;
}

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

/**
 * Get the user-specified preference list of a partition
 * @param partitionName the name of the partition
 * @return a list of instances that can serve replicas of the partition
 */
public List<String> getPreferenceList(String partitionName) {
 List<String> instanceStateList = _record.getListField(partitionName);
 if (instanceStateList != null) {
  return instanceStateList;
 }
 return null;
}

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

public SemiAutoModeISBuilder assignPreferenceList(String partitionName, String... instanceNames) {
  add(partitionName);
  _record.getListField(partitionName).addAll(Arrays.asList(instanceNames));
  return this;
 }
}

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

public void add(String partitionName) {
 if (_record.getListField(partitionName) == null) {
  _record.setListField(partitionName, new ArrayList<String>());
 }
}

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

public AutoModeISBuilder assignPreferenceList(String partitionName, String... instanceNames) {
 add(partitionName);
 _record.getListField(partitionName).addAll(Arrays.asList(instanceNames));
 return this;
}

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

/**
 * Get history list
 * @return
 */
public List<String> getHistoryList() {
 List<String> historyList = _record.getListField(ConfigProperty.HISTORY.name());
 if (historyList == null) {
  historyList = new ArrayList<String>();
 }
 return historyList;
}

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

/**
 * Get a list of partitions associated with this message
 * @return list of partition names
 */
public List<String> getPartitionNames() {
 List<String> partitionNames = _record.getListField(Attributes.PARTITION_NAME.toString());
 if (partitionNames == null) {
  return Collections.emptyList();
 }
 return partitionNames;
}

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

/**
 * Whether there are any relay message attached to this message.
 *
 * @return
 */
public boolean hasRelayMessages() {
 List<String> relayHosts = _record.getListField(Attributes.RELAY_PARTICIPANTS.name());
 return (relayHosts != null && relayHosts.size() > 0);
}

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

public SemiAutoModeISBuilder assignPreferenceList(String partitionName, String... instanceNames) {
  add(partitionName);
  _record.getListField(partitionName).addAll(Arrays.asList(instanceNames));
  return this;
 }
}

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

public SemiAutoModeISBuilder add(String partitionName) {
 if (_record.getListField(partitionName) == null) {
  _record.setListField(partitionName, new ArrayList<String>());
 }
 return this;
}

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

/**
  * Add a partition, Helix will automatically assign the placement and state
  * for this partition at runtime.
  * @param partitionName
  */
 public AutoRebalanceModeISBuilder add(String partitionName) {
  if (_record.getListField(partitionName) == null) {
   _record.setListField(partitionName, new ArrayList<String>());
  }

  return this;
 }
}

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

/**
  * Add a partition, Helix will automatically assign the placement and state
  * for this partition at runtime.
  * @param partitionName
  */
 public FullAutoModeISBuilder add(String partitionName) {
  if (_record.getListField(partitionName) == null) {
   _record.setListField(partitionName, new ArrayList<String>());
  }

  return this;
 }
}

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

/**
  * Add a partition, Helix will automatically assign the placement and state
  * for this partition at runtime.
  * @param partitionName
  */
 public AutoRebalanceModeISBuilder add(String partitionName) {
  if (_record.getListField(partitionName) == null) {
   _record.setListField(partitionName, new ArrayList<String>());
  }

  return this;
 }
}

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

/**
 * Get arbitrary tags associated with the instance
 * @return a list of tags
 */
public List<String> getTags() {
 List<String> tags = getRecord().getListField(InstanceConfigProperty.TAG_LIST.toString());
 if (tags == null) {
  tags = new ArrayList<String>(0);
 }
 return tags;
}

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

/**
 * Get arbitrary tags associated with the instance
 * @return a list of tags
 */
public List<String> getTags() {
 List<String> tags = getRecord().getListField(InstanceConfigProperty.TAG_LIST.toString());
 if (tags == null) {
  tags = new ArrayList<String>(0);
 }
 return tags;
}

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

/**
 * Check if an instance contains a tag
 * @param tag the tag to check
 * @return true if the instance contains the tag, false otherwise
 */
public boolean containsTag(String tag) {
 List<String> tags = getRecord().getListField(InstanceConfigProperty.TAG_LIST.toString());
 if (tags == null) {
  return false;
 }
 return tags.contains(tag);
}

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