gpt4 book ai didi

org.apache.helix.messaging.ZNRecordRow类的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 03:27:31 26 4
gpt4 key购买 nike

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

ZNRecordRow介绍

[英]A Normalized form of ZNRecord
[中]一种规范化的记录形式

代码示例

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

List<ZNRecordRow> allRows = ZNRecordRow.flatten(HelixProperty.convertToList(properties));
   (liveParticipants.contains(row.getRecordId()) || liveParticipants.contains(row.getMapSubKey()))) {
  result.add(row);
 Map<String, String> resultRow = new HashMap<String, String>();
 resultRow.put("instanceName", !recipientCriteria.getInstanceName().equals("") ?
   (!Strings.isNullOrEmpty(row.getMapSubKey()) ? row.getMapSubKey() : row.getRecordId()) : "");
 resultRow.put("resourceName", !recipientCriteria.getResource().equals("") ? row.getRecordId() : "");
 resultRow.put("partitionName", !recipientCriteria.getPartition().equals("") ? row.getMapKey() : "");
 resultRow.put("partitionState", !recipientCriteria.getPartitionState().equals("") ? row.getMapValue() : "");
 selected.add(resultRow);

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

public static List<ZNRecordRow> flatten(Collection<ZNRecord> recordList) {
 List<ZNRecordRow> result = new ArrayList<ZNRecordRow>();
 for (ZNRecord record : recordList) {
  result.addAll(flatten(record));
 }
 return result;
}

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

public static List<ZNRecordRow> convertSimpleFields(ZNRecord record) {
 List<ZNRecordRow> result = new ArrayList<ZNRecordRow>();
 for (String key : record.getSimpleFields().keySet()) {
  ZNRecordRow row = new ZNRecordRow();
  row.putField(ZNRECORD_ID, record.getId());
  row.putField(SIMPLE_KEY, key);
  row.putField(SIMPLE_VALUE, record.getSimpleField(key));
  result.add(row);
 }
 return result;
}

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

public static List<ZNRecordRow> flatten(ZNRecord record) {
 List<ZNRecordRow> result = convertMapFields(record);
 result.addAll(convertListFields(record));
 result.addAll(convertSimpleFields(record));
 return result;
}

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

public static List<ZNRecordRow> flatten(Collection<ZNRecord> recordList) {
 List<ZNRecordRow> result = new ArrayList<ZNRecordRow>();
 for (ZNRecord record : recordList) {
  result.addAll(flatten(record));
 }
 return result;
}

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

public static List<ZNRecordRow> convertSimpleFields(ZNRecord record) {
 List<ZNRecordRow> result = new ArrayList<ZNRecordRow>();
 for (String key : record.getSimpleFields().keySet()) {
  ZNRecordRow row = new ZNRecordRow();
  row.putField(ZNRECORD_ID, record.getId());
  row.putField(SIMPLE_KEY, key);
  row.putField(SIMPLE_VALUE, record.getSimpleField(key));
  result.add(row);
 }
 return result;
}

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

public static List<ZNRecordRow> flatten(ZNRecord record) {
 List<ZNRecordRow> result = convertMapFields(record);
 result.addAll(convertListFields(record));
 result.addAll(convertSimpleFields(record));
 return result;
}

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

/**
 * Check if a given row matches the specified criteria
 * @param criteria the criteria
 * @param row row of currently persisted data
 * @return true if it matches, false otherwise
 */
private boolean rowMatches(Criteria criteria, ZNRecordRow row) {
 String instanceName = normalizePattern(criteria.getInstanceName());
 String resourceName = normalizePattern(criteria.getResource());
 String partitionName = normalizePattern(criteria.getPartition());
 String partitionState = normalizePattern(criteria.getPartitionState());
 return stringMatches(instanceName, row.getMapSubKey()) && stringMatches(resourceName, row.getRecordId())
   && stringMatches(partitionName, row.getMapKey()) && stringMatches(partitionState, row.getMapValue());
}

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

public static List<ZNRecordRow> convertMapFields(ZNRecord record) {
 List<ZNRecordRow> result = new ArrayList<ZNRecordRow>();
 for (String key0 : record.getMapFields().keySet()) {
  for (String key1 : record.getMapField(key0).keySet()) {
   ZNRecordRow row = new ZNRecordRow();
   row.putField(ZNRECORD_ID, record.getId());
   row.putField(MAP_KEY, key0);
   row.putField(MAP_SUBKEY, key1);
   row.putField(MAP_VALUE, record.getMapField(key0).get(key1));
   result.add(row);
  }
 }
 return result;
}

代码示例来源:origin: org.apache.gobblin/gobblin-cluster

List<ZNRecordRow> allRows = ZNRecordRow.flatten(HelixProperty.convertToList(properties));
   (liveParticipants.contains(row.getRecordId()) || liveParticipants.contains(row.getMapSubKey()))) {
  result.add(row);
 Map<String, String> resultRow = new HashMap<String, String>();
 resultRow.put("instanceName", !recipientCriteria.getInstanceName().equals("") ?
   (!Strings.isNullOrEmpty(row.getMapSubKey()) ? row.getMapSubKey() : row.getRecordId()) : "");
 resultRow.put("resourceName", !recipientCriteria.getResource().equals("") ? row.getRecordId() : "");
 resultRow.put("partitionName", !recipientCriteria.getPartition().equals("") ? row.getMapKey() : "");
 resultRow.put("partitionState", !recipientCriteria.getPartitionState().equals("") ? row.getMapValue() : "");
 selected.add(resultRow);

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

public static List<ZNRecordRow> convertMapFields(ZNRecord record) {
 List<ZNRecordRow> result = new ArrayList<ZNRecordRow>();
 for (String key0 : record.getMapFields().keySet()) {
  for (String key1 : record.getMapField(key0).keySet()) {
   ZNRecordRow row = new ZNRecordRow();
   row.putField(ZNRECORD_ID, record.getId());
   row.putField(MAP_KEY, key0);
   row.putField(MAP_SUBKEY, key1);
   row.putField(MAP_VALUE, record.getMapField(key0).get(key1));
   result.add(row);
  }
 }
 return result;
}

代码示例来源:origin: com.linkedin.gobblin/gobblin-cluster

List<ZNRecordRow> allRows = ZNRecordRow.flatten(HelixProperty.convertToList(properties));
   (liveParticipants.contains(row.getRecordId()) || liveParticipants.contains(row.getMapSubKey()))) {
  result.add(row);
 Map<String, String> resultRow = new HashMap<String, String>();
 resultRow.put("instanceName", !recipientCriteria.getInstanceName().equals("") ?
   (!Strings.isNullOrEmpty(row.getMapSubKey()) ? row.getMapSubKey() : row.getRecordId()) : "");
 resultRow.put("resourceName", !recipientCriteria.getResource().equals("") ? row.getRecordId() : "");
 resultRow.put("partitionName", !recipientCriteria.getPartition().equals("") ? row.getMapKey() : "");
 resultRow.put("partitionState", !recipientCriteria.getPartitionState().equals("") ? row.getMapValue() : "");
 selected.add(resultRow);

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

public static List<ZNRecordRow> convertListFields(ZNRecord record) {
 List<ZNRecordRow> result = new ArrayList<ZNRecordRow>();
 for (String key : record.getListFields().keySet()) {
  int order = 0;
  for (String value : record.getListField(key)) {
   ZNRecordRow row = new ZNRecordRow();
   row.putField(ZNRECORD_ID, record.getId());
   row.putField(LIST_KEY, key);
   row.putField(LIST_VALUE, record.getSimpleField(key));
   row.putField(LIST_VALUE_INDEX, "" + order);
   order++;
   result.add(row);
  }
 }
 return result;
}

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

/**
 * Check if a given row matches the specified criteria
 * @param criteria the criteria
 * @param row row of currently persisted data
 * @return true if it matches, false otherwise
 */
private boolean rowMatches(Criteria criteria, ZNRecordRow row) {
 String instanceName = normalizePattern(criteria.getInstanceName());
 String resourceName = normalizePattern(criteria.getResource());
 String partitionName = normalizePattern(criteria.getPartition());
 String partitionState = normalizePattern(criteria.getPartitionState());
 return (stringMatches(instanceName, Strings.nullToEmpty(row.getMapSubKey())) ||
     stringMatches(instanceName, Strings.nullToEmpty(row.getRecordId())))
   && stringMatches(resourceName, Strings.nullToEmpty(row.getRecordId()))
   && stringMatches(partitionName, Strings.nullToEmpty(row.getMapKey()))
   && stringMatches(partitionState, Strings.nullToEmpty(row.getMapValue()));
}

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

public static List<ZNRecordRow> convertListFields(ZNRecord record) {
 List<ZNRecordRow> result = new ArrayList<ZNRecordRow>();
 for (String key : record.getListFields().keySet()) {
  int order = 0;
  for (String value : record.getListField(key)) {
   ZNRecordRow row = new ZNRecordRow();
   row.putField(ZNRECORD_ID, record.getId());
   row.putField(LIST_KEY, key);
   row.putField(LIST_VALUE, record.getSimpleField(key));
   row.putField(LIST_VALUE_INDEX, "" + order);
   order++;
   result.add(row);
  }
 }
 return result;
}

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

/**
 * Check if a given row matches the specified criteria
 * @param criteria the criteria
 * @param row row of currently persisted data
 * @return true if it matches, false otherwise
 */
private boolean rowMatches(Criteria criteria, ZNRecordRow row) {
 String instanceName = normalizePattern(criteria.getInstanceName());
 String resourceName = normalizePattern(criteria.getResource());
 String partitionName = normalizePattern(criteria.getPartition());
 String partitionState = normalizePattern(criteria.getPartitionState());
 return (stringMatches(instanceName, Strings.nullToEmpty(row.getMapSubKey())) ||
     stringMatches(instanceName, Strings.nullToEmpty(row.getRecordId())))
   && stringMatches(resourceName, Strings.nullToEmpty(row.getRecordId()))
   && stringMatches(partitionName, Strings.nullToEmpty(row.getMapKey()))
   && stringMatches(partitionState, Strings.nullToEmpty(row.getMapValue()));
}

代码示例来源:origin: org.apache.gobblin/gobblin-cluster

/**
 * Check if a given row matches the specified criteria
 * @param criteria the criteria
 * @param row row of currently persisted data
 * @return true if it matches, false otherwise
 */
private boolean rowMatches(Criteria criteria, ZNRecordRow row) {
 String instanceName = normalizePattern(criteria.getInstanceName());
 String resourceName = normalizePattern(criteria.getResource());
 String partitionName = normalizePattern(criteria.getPartition());
 String partitionState = normalizePattern(criteria.getPartitionState());
 return stringMatches(instanceName, row.getMapSubKey()) && stringMatches(resourceName, row.getRecordId())
   && stringMatches(partitionName, row.getMapKey()) && stringMatches(partitionState, row.getMapValue());
}

代码示例来源:origin: com.linkedin.gobblin/gobblin-cluster

/**
 * Check if a given row matches the specified criteria
 * @param criteria the criteria
 * @param row row of currently persisted data
 * @return true if it matches, false otherwise
 */
private boolean rowMatches(Criteria criteria, ZNRecordRow row) {
 String instanceName = normalizePattern(criteria.getInstanceName());
 String resourceName = normalizePattern(criteria.getResource());
 String partitionName = normalizePattern(criteria.getPartition());
 String partitionState = normalizePattern(criteria.getPartitionState());
 return stringMatches(instanceName, row.getMapSubKey()) && stringMatches(resourceName, row.getRecordId())
   && stringMatches(partitionName, row.getMapKey()) && stringMatches(partitionState, row.getMapValue());
}

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

List<ZNRecordRow> allRows = ZNRecordRow.flatten(HelixProperty.convertToList(properties));
   (liveParticipants.contains(row.getRecordId()) || liveParticipants.contains(row.getMapSubKey()))) {
  result.add(row);
 Map<String, String> resultRow = new HashMap<String, String>();
 resultRow.put("instanceName", !recipientCriteria.getInstanceName().equals("") ?
   (!Strings.isNullOrEmpty(row.getMapSubKey()) ? row.getMapSubKey() : row.getRecordId()) :
   "");
 resultRow.put("resourceName", !recipientCriteria.getResource().equals("") ? row.getRecordId()
   : "");
 resultRow.put("partitionName", !recipientCriteria.getPartition().equals("") ? row.getMapKey()
   : "");
 resultRow.put("partitionState",
   !recipientCriteria.getPartitionState().equals("") ? row.getMapValue() : "");
 selected.add(resultRow);

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

List<ZNRecordRow> allRows = ZNRecordRow.flatten(HelixProperty.convertToList(properties));
   (liveParticipants.contains(row.getRecordId()) || liveParticipants.contains(row.getMapSubKey()))) {
  result.add(row);
 Map<String, String> resultRow = new HashMap<String, String>();
 resultRow.put("instanceName", !recipientCriteria.getInstanceName().equals("") ?
   (!Strings.isNullOrEmpty(row.getMapSubKey()) ? row.getMapSubKey() : row.getRecordId()) :
   "");
 resultRow.put("resourceName", !recipientCriteria.getResource().equals("") ? row.getRecordId()
   : "");
 resultRow.put("partitionName", !recipientCriteria.getPartition().equals("") ? row.getMapKey()
   : "");
 resultRow.put("partitionState",
   !recipientCriteria.getPartitionState().equals("") ? row.getMapValue() : "");
 selected.add(resultRow);

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