gpt4 book ai didi

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

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

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

ZkHelixPropertyStore.getChildren介绍

暂无

代码示例

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

public List<String> getAllTenantTables()
  throws Exception {
 String tableConfigPath = "/CONFIGS/TABLE";
 List<ZNRecord> tableConfigs = _propertyStore.getChildren(tableConfigPath, null, 0);
 List<String> tables = new ArrayList<>(128);
 for (ZNRecord znRecord : tableConfigs) {
  TableConfig tableConfig = TableConfig.fromZnRecord(znRecord);
  if (tableConfig.getTenantConfig().getServer().equals(_tenantName)) {
   tables.add(tableConfig.getTableName());
  }
 }
 return tables;
}

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

/**
 * NOTE: this method is very expensive, use {@link #getSegments(ZkHelixPropertyStore, String)} instead if only segment
 * segment names are needed.
 */
public static List<RealtimeSegmentZKMetadata> getRealtimeSegmentZKMetadataListForTable(
  ZkHelixPropertyStore<ZNRecord> propertyStore, String resourceName) {
 List<RealtimeSegmentZKMetadata> resultList = new ArrayList<>();
 if (propertyStore == null) {
  return resultList;
 }
 String realtimeTableName = TableNameBuilder.REALTIME.tableNameWithType(resourceName);
 if (propertyStore.exists(constructPropertyStorePathForResource(realtimeTableName), AccessOption.PERSISTENT)) {
  List<ZNRecord> znRecordList = propertyStore
    .getChildren(constructPropertyStorePathForResource(realtimeTableName), null, AccessOption.PERSISTENT);
  if (znRecordList != null) {
   for (ZNRecord record : znRecordList) {
    resultList.add(new RealtimeSegmentZKMetadata(record));
   }
  }
 }
 return resultList;
}

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

/**
 * NOTE: this method is very expensive, use {@link #getSegments(ZkHelixPropertyStore, String)} instead if only segment
 * segment names are needed.
 */
public static List<OfflineSegmentZKMetadata> getOfflineSegmentZKMetadataListForTable(
  ZkHelixPropertyStore<ZNRecord> propertyStore, String tableName) {
 List<OfflineSegmentZKMetadata> resultList = new ArrayList<>();
 if (propertyStore == null) {
  return resultList;
 }
 String offlineTableName = TableNameBuilder.OFFLINE.tableNameWithType(tableName);
 if (propertyStore.exists(constructPropertyStorePathForResource(offlineTableName), AccessOption.PERSISTENT)) {
  List<ZNRecord> znRecordList = propertyStore
    .getChildren(constructPropertyStorePathForResource(offlineTableName), null, AccessOption.PERSISTENT);
  if (znRecordList != null) {
   for (ZNRecord record : znRecordList) {
    resultList.add(new OfflineSegmentZKMetadata(record));
   }
  }
 }
 return resultList;
}

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

/**
 * rebalances all tables for the tenant
 * @param tenantName
 */
public void rebalanceTenantTables(String tenantName)
  throws Exception {
 String tableConfigPath = "/CONFIGS/TABLE";
 List<Stat> stats = new ArrayList<>();
 List<ZNRecord> tableConfigs = propertyStore.getChildren(tableConfigPath, stats, 0);
 String rawTenantName = tenantName.replaceAll("_OFFLINE", "").replace("_REALTIME", "");
 int nRebalances = 0;
 for (ZNRecord znRecord : tableConfigs) {
  TableConfig tableConfig;
  try {
   tableConfig = TableConfig.fromZnRecord(znRecord);
  } catch (Exception e) {
   LOGGER.warn("Failed to parse table configuration for ZnRecord id: {}. Skipping", znRecord.getId());
   continue;
  }
  if (tableConfig.getTenantConfig().getServer().equals(rawTenantName)) {
   LOGGER.info(tableConfig.getTableName() + ":" + tableConfig.getTenantConfig().getServer());
   nRebalances++;
   rebalanceTable(tableConfig.getTableName(), tenantName);
  }
 }
 if (nRebalances == 0) {
  LOGGER.info("No tables found for tenant " + tenantName);
 }
}

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

/**
 * NOTE: this method is very expensive, use {@link #getLLCRealtimeSegments(ZkHelixPropertyStore, String)} instead if
 * only segment names are needed.
 */
public static List<LLCRealtimeSegmentZKMetadata> getLLCRealtimeSegmentZKMetadataListForTable(
  ZkHelixPropertyStore<ZNRecord> propertyStore, String resourceName) {
 List<LLCRealtimeSegmentZKMetadata> resultList = new ArrayList<>();
 if (propertyStore == null) {
  return resultList;
 }
 String realtimeTableName = TableNameBuilder.REALTIME.tableNameWithType(resourceName);
 if (propertyStore.exists(constructPropertyStorePathForResource(realtimeTableName), AccessOption.PERSISTENT)) {
  List<ZNRecord> znRecordList = propertyStore
    .getChildren(constructPropertyStorePathForResource(realtimeTableName), null, AccessOption.PERSISTENT);
  if (znRecordList != null) {
   for (ZNRecord record : znRecordList) {
    RealtimeSegmentZKMetadata realtimeSegmentZKMetadata = new RealtimeSegmentZKMetadata(record);
    if (SegmentName.isLowLevelConsumerSegmentName(realtimeSegmentZKMetadata.getSegmentName())) {
     resultList.add(new LLCRealtimeSegmentZKMetadata(record));
    }
   }
  }
 }
 return resultList;
}

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

LOGGER.info("Received change notification for path: {}", path);
List<Stat> stats = new ArrayList<>();
List<ZNRecord> tableConfigs = _pinotHelixResourceManager.getPropertyStore().getChildren(TABLE_CONFIG, stats, 0);

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