gpt4 book ai didi

org.apache.helix.store.zk.ZkHelixPropertyStore.getChildNames()方法的使用及代码示例

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

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

ZkHelixPropertyStore.getChildNames介绍

暂无

代码示例

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

protected List<String> getExistingSegments(String realtimeTableName) {
 String propStorePath = ZKMetadataProvider.constructPropertyStorePathForResource(realtimeTableName);
 return _propertyStore.getChildNames(propStorePath, AccessOption.PERSISTENT);
}

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

private List<String> getTableNames()
  throws Exception {
 if (_tableNames == null) {
  // Get all table names.
  return _helixPropertyStore.getChildNames(TABLE_CONFIG_PATH, 0);
 } else {
  // Extract space separated table names.
  Set<String> tableNames = new HashSet<>();
  for (String tableName : _tableNames.split(" ")) {
   if (!tableName.isEmpty()) {
    tableNames.add(tableName);
   }
  }
  if (tableNames.size() == 0) {
   throw new RuntimeException("No table name specified.");
  }
  return new ArrayList<>(tableNames);
 }
}

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

private List<String> getSegmentNames(String tableName) {
 return _propertyStore.getChildNames(ZKMetadataProvider.constructPropertyStorePathForResource(tableName), 0);
}

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

private List<String> getSchemaNames()
   throws Exception {
  if (_schemaNames == null) {
   // Get all schema names.
   return _helixPropertyStore.getChildNames(SCHEMA_PATH, 0);
  } else {
   // Extract space separated schema names.
   Set<String> schemaNames = new HashSet<>();
   for (String schemaName : _schemaNames.split(" ")) {
    if (!schemaName.isEmpty()) {
     schemaNames.add(schemaName);
    }
   }
   if (schemaNames.size() == 0) {
    throw new RuntimeException("No schema name specified.");
   }
   return new ArrayList<>(schemaNames);
  }
 }
}

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

public List<String> getSchemaNames() {
 return _propertyStore
   .getChildNames(PinotHelixPropertyStoreZnRecordProvider.forSchema(_propertyStore).getRelativePath(),
     AccessOption.PERSISTENT);
}

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

/**
 * Returns the segments for the given table.
 *
 * @param propertyStore Helix property store
 * @param tableNameWithType Table name with type suffix
 * @return List of segment names
 */
public static List<String> getSegments(ZkHelixPropertyStore<ZNRecord> propertyStore, String tableNameWithType) {
 String segmentsPath = constructPropertyStorePathForResource(tableNameWithType);
 if (propertyStore.exists(segmentsPath, AccessOption.PERSISTENT)) {
  return propertyStore.getChildNames(segmentsPath, AccessOption.PERSISTENT);
 } else {
  return Collections.emptyList();
 }
}

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

/**
 * Returns the LLC realtime segments for the given table.
 *
 * @param propertyStore Helix property store
 * @param realtimeTableName Realtime table name
 * @return List of LLC realtime segment names
 */
public static List<String> getLLCRealtimeSegments(ZkHelixPropertyStore<ZNRecord> propertyStore,
  String realtimeTableName) {
 List<String> llcRealtimeSegments = new ArrayList<>();
 String segmentsPath = constructPropertyStorePathForResource(realtimeTableName);
 if (propertyStore.exists(segmentsPath, AccessOption.PERSISTENT)) {
  List<String> segments = propertyStore.getChildNames(segmentsPath, AccessOption.PERSISTENT);
  for (String segment : segments) {
   if (SegmentName.isLowLevelConsumerSegmentName(segment)) {
    llcRealtimeSegments.add(segment);
   }
  }
 }
 return llcRealtimeSegments;
}

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

@Test
public void testSegmentFlushSize()
  throws Exception {
 String zkSegmentsPath = "/SEGMENTS/" + TableNameBuilder.REALTIME.tableNameWithType(getTableName());
 List<String> segmentNames = _propertyStore.getChildNames(zkSegmentsPath, 0);
 for (String segmentName : segmentNames) {
  ZNRecord znRecord = _propertyStore.get(zkSegmentsPath + "/" + segmentName, null, 0);
  Assert.assertEquals(znRecord.getSimpleField(CommonConstants.Segment.FLUSH_THRESHOLD_SIZE),
    Integer.toString(getRealtimeSegmentFlushSize() / getNumKafkaPartitions()),
    "Segment: " + segmentName + " does not have the expected flush size");
 }
}

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

_pinotHelixResourceManager.getPropertyStore().getChildNames(SEGMENTS_PATH + "/" + realtimeTable, 0);

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

@Override
public List<String> getChildNames(String parentPath, int options) {
 if (_fallbackStore == null) {
  return super.getChildNames(parentPath, options);
 } else {
  List<String> childs = super.getChildNames(parentPath, options);
  List<String> fallbackChilds = _fallbackStore.getChildNames(parentPath, options);
  if (childs == null && fallbackChilds == null) {
   return null;
  }
  // merge two child lists
  Set<String> allChildSet = new HashSet<String>();
  if (childs != null) {
   allChildSet.addAll(childs);
  }
  if (fallbackChilds != null) {
   allChildSet.addAll(fallbackChilds);
  }
  List<String> allChilds = new ArrayList<String>(allChildSet);
  return allChilds;
 }
}

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

@Override
public List<String> getChildNames(String parentPath, int options) {
 if (_fallbackStore == null) {
  return super.getChildNames(parentPath, options);
 } else {
  List<String> childs = super.getChildNames(parentPath, options);
  List<String> fallbackChilds = _fallbackStore.getChildNames(parentPath, options);
  if (childs == null && fallbackChilds == null) {
   return null;
  }
  // merge two child lists
  Set<String> allChildSet = new HashSet<String>();
  if (childs != null) {
   allChildSet.addAll(childs);
  }
  if (fallbackChilds != null) {
   allChildSet.addAll(fallbackChilds);
  }
  List<String> allChilds = new ArrayList<String>(allChildSet);
  return allChilds;
 }
}

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