gpt4 book ai didi

org.apache.pinot.common.metadata.ZKMetadataProvider.getTableConfig()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 06:34:49 28 4
gpt4 key购买 nike

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

ZKMetadataProvider.getTableConfig介绍

暂无

代码示例

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

@Override
 public TableConfig load(String tableNameWithType)
   throws Exception {
  return ZKMetadataProvider.getTableConfig(_propertyStore, tableNameWithType);
 }
});

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

/**
 * Get the table config for the given table name with type suffix.
 *
 * @param tableNameWithType Table name with type suffix
 * @return Table config
 */
@Nullable
public TableConfig getTableConfig(@Nonnull String tableNameWithType) {
 return ZKMetadataProvider.getTableConfig(_propertyStore, tableNameWithType);
}

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

@Nullable
public static TableConfig getOfflineTableConfig(@Nonnull ZkHelixPropertyStore<ZNRecord> propertyStore,
  @Nonnull String tableName) {
 return getTableConfig(propertyStore, TableNameBuilder.OFFLINE.tableNameWithType(tableName));
}

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

@Nullable
public static TableConfig getRealtimeTableConfig(@Nonnull ZkHelixPropertyStore<ZNRecord> propertyStore,
  @Nonnull String tableName) {
 return getTableConfig(propertyStore, TableNameBuilder.REALTIME.tableNameWithType(tableName));
}

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

@Override
public void addOfflineSegment(@Nonnull String offlineTableName, @Nonnull String segmentName, @Nonnull File indexDir)
  throws Exception {
 LOGGER.info("Adding segment: {} to table: {}", segmentName, offlineTableName);
 TableConfig tableConfig = ZKMetadataProvider.getTableConfig(_propertyStore, offlineTableName);
 Preconditions.checkNotNull(tableConfig);
 _tableDataManagerMap.computeIfAbsent(offlineTableName, k -> createTableDataManager(k, tableConfig))
   .addSegment(indexDir, new IndexLoadingConfig(_instanceDataManagerConfig, tableConfig));
 LOGGER.info("Added segment: {} to table: {}", segmentName, offlineTableName);
}

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

@Override
public void addRealtimeSegment(@Nonnull String realtimeTableName, @Nonnull String segmentName)
  throws Exception {
 LOGGER.info("Adding segment: {} to table: {}", segmentName, realtimeTableName);
 TableConfig tableConfig = ZKMetadataProvider.getTableConfig(_propertyStore, realtimeTableName);
 Preconditions.checkNotNull(tableConfig);
 _tableDataManagerMap.computeIfAbsent(realtimeTableName, k -> createTableDataManager(k, tableConfig))
   .addSegment(segmentName, tableConfig, new IndexLoadingConfig(_instanceDataManagerConfig, tableConfig));
 LOGGER.info("Added segment: {} to table: {}", segmentName, realtimeTableName);
}

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

@Override
public void reloadSegment(@Nonnull String tableNameWithType, @Nonnull String segmentName)
  throws Exception {
 LOGGER.info("Reloading single segment: {} in table: {}", segmentName, tableNameWithType);
 SegmentMetadata segmentMetadata = getSegmentMetadata(tableNameWithType, segmentName);
 if (segmentMetadata == null) {
  return;
 }
 TableConfig tableConfig = ZKMetadataProvider.getTableConfig(_propertyStore, tableNameWithType);
 Preconditions.checkNotNull(tableConfig);
 Schema schema = null;
 // For OFFLINE table, try to get schema for default columns
 if (TableNameBuilder.OFFLINE.tableHasTypeSuffix(tableNameWithType)) {
  schema = ZKMetadataProvider.getTableSchema(_propertyStore, tableNameWithType);
 }
 reloadSegment(tableNameWithType, segmentMetadata, tableConfig, schema);
 LOGGER.info("Reloaded single segment: {} in table: {}", segmentName, tableNameWithType);
}

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

@Override
public void reloadAllSegments(@Nonnull String tableNameWithType)
  throws Exception {
 LOGGER.info("Reloading all segments in table: {}", tableNameWithType);
 TableConfig tableConfig = ZKMetadataProvider.getTableConfig(_propertyStore, tableNameWithType);
 Preconditions.checkNotNull(tableConfig);
 Schema schema = null;
 // For OFFLINE table, try to get schema for default columns
 if (TableNameBuilder.OFFLINE.tableHasTypeSuffix(tableNameWithType)) {
  schema = ZKMetadataProvider.getTableSchema(_propertyStore, tableNameWithType);
 }
 for (SegmentMetadata segmentMetadata : getAllSegmentsMetadata(tableNameWithType)) {
  reloadSegment(tableNameWithType, segmentMetadata, tableConfig, schema);
 }
 LOGGER.info("Reloaded all segments in table: {}", tableNameWithType);
}

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

public void updateMetadataConfigFor(String tableName, TableType type, TableCustomConfig newConfigs)
  throws Exception {
 String tableNameWithType = TableNameBuilder.forType(type).tableNameWithType(tableName);
 TableConfig tableConfig = ZKMetadataProvider.getTableConfig(_propertyStore, tableNameWithType);
 if (tableConfig == null) {
  throw new RuntimeException("Table: " + tableName + " of type: " + type + " does not exist");
 }
 tableConfig.setCustomConfig(newConfigs);
 setExistingTableConfig(tableConfig, tableNameWithType, type);
}

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

public void updateSegmentsValidationAndRetentionConfigFor(String tableName, TableType type,
  SegmentsValidationAndRetentionConfig newConfigs)
  throws Exception {
 String tableNameWithType = TableNameBuilder.forType(type).tableNameWithType(tableName);
 TableConfig tableConfig = ZKMetadataProvider.getTableConfig(_propertyStore, tableNameWithType);
 if (tableConfig == null) {
  throw new RuntimeException("Table: " + tableName + " of type: " + type + " does not exist");
 }
 tableConfig.setValidationConfig(newConfigs);
 setExistingTableConfig(tableConfig, tableNameWithType, type);
}

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

public PinotResourceManagerResponse rebuildBrokerResourceFromHelixTags(String tableNameWithType)
  throws Exception {
 TableConfig tableConfig;
 try {
  tableConfig = ZKMetadataProvider.getTableConfig(_propertyStore, tableNameWithType);
 } catch (Exception e) {
  LOGGER.warn("Caught exception while getting table config for table {}", tableNameWithType, e);
  throw new InvalidTableConfigException(
    "Failed to fetch broker tag for table " + tableNameWithType + " due to exception: " + e.getMessage());
 }
 if (tableConfig == null) {
  LOGGER.warn("Table " + tableNameWithType + " does not exist");
  throw new InvalidConfigException(
    "Invalid table configuration for table " + tableNameWithType + ". Table does not exist");
 }
 return rebuildBrokerResource(tableNameWithType,
   getAllInstancesForBrokerTenant(tableConfig.getTenantConfig().getBroker()));
}

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

public void updateIndexingConfigFor(String tableName, TableType type, IndexingConfig newConfigs)
  throws Exception {
 String tableNameWithType = TableNameBuilder.forType(type).tableNameWithType(tableName);
 TableConfig tableConfig = ZKMetadataProvider.getTableConfig(_propertyStore, tableNameWithType);
 if (tableConfig == null) {
  throw new RuntimeException("Table: " + tableName + " of type: " + type + " does not exist");
 }
 tableConfig.setIndexingConfig(newConfigs);
 setExistingTableConfig(tableConfig, tableNameWithType, type);
 if (type == TableType.REALTIME) {
  ensureRealtimeClusterIsSetUp(tableConfig, tableName, newConfigs);
 }
}

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

/**
 * Get QuotaConfig from property store.
 * @param rawTableName table name without table type.
 * @param tableType table type: offline or real-time.
 * @return QuotaConfig, which could be null.
 */
private QuotaConfig getQuotaConfigFromPropertyStore(String rawTableName, CommonConstants.Helix.TableType tableType) {
 ZkHelixPropertyStore<ZNRecord> propertyStore = _helixManager.getHelixPropertyStore();
 String tableNameWithType = TableNameBuilder.forType(tableType).tableNameWithType(rawTableName);
 TableConfig tableConfig = ZKMetadataProvider.getTableConfig(propertyStore, tableNameWithType);
 if (tableConfig == null) {
  return null;
 }
 return tableConfig.getQuotaConfig();
}

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

private void addInstanceToBrokerIdealState(String brokerTenantTag, String instanceName) {
 IdealState tableIdealState =
   _helixAdmin.getResourceIdealState(_helixClusterName, CommonConstants.Helix.BROKER_RESOURCE_INSTANCE);
 for (String tableNameWithType : tableIdealState.getPartitionSet()) {
  TableConfig tableConfig = ZKMetadataProvider.getTableConfig(_propertyStore, tableNameWithType);
  Preconditions.checkNotNull(tableConfig);
  String brokerTag = TagNameUtils.getBrokerTagForTenant(tableConfig.getTenantConfig().getBroker());
  if (brokerTag.equals(brokerTenantTag)) {
   tableIdealState.setPartitionState(tableNameWithType, instanceName, BrokerOnlineOfflineStateModel.ONLINE);
  }
 }
 _helixAdmin
   .setResourceIdealState(_helixClusterName, CommonConstants.Helix.BROKER_RESOURCE_INSTANCE, tableIdealState);
}

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

TableConfig tableConfig = ZKMetadataProvider.getTableConfig(_propertyStore, tableNameWithType);
Preconditions.checkNotNull(tableConfig);
IndexingConfig indexingConfig = tableConfig.getIndexingConfig();

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

TableConfig tableConfig = ZKMetadataProvider.getTableConfig(propertyStore, offlineTableName);
ReplicaGroupStrategyConfig replicaGroupStrategyConfig =
  tableConfig.getValidationConfig().getReplicaGroupStrategyConfig();

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

@Transition(from = "OFFLINE", to = "ONLINE")
public void onBecomeOnlineFromOffline(Message message, NotificationContext context) {
 try {
  LOGGER.info("BrokerResourceOnlineOfflineStateModel.onBecomeOnlineFromOffline() : " + message);
  Builder keyBuilder = _helixManager.getHelixDataAccessor().keyBuilder();
  String tableName = message.getPartitionName();
  HelixDataAccessor helixDataAccessor = _helixManager.getHelixDataAccessor();
  List<InstanceConfig> instanceConfigList = helixDataAccessor.getChildValues(keyBuilder.instanceConfigs());
  TableConfig tableConfig = ZKMetadataProvider.getTableConfig(_propertyStore, tableName);
  _helixExternalViewBasedRouting.markDataResourceOnline(tableConfig,
    HelixHelper.getExternalViewForResource(_helixAdmin, _helixManager.getClusterName(), tableName),
    instanceConfigList);
  _tableQueryQuotaManager.initTableQueryQuota(tableConfig, HelixHelper
    .getExternalViewForResource(_helixAdmin, _helixManager.getClusterName(), BROKER_RESOURCE_INSTANCE));
 } catch (Exception e) {
  LOGGER.error("Caught exception during OFFLINE -> ONLINE transition", e);
  Utils.rethrowException(e);
  throw new AssertionError("Should not reach this");
 }
}

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