gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-14 05:22:49 31 4
gpt4 key购买 nike

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

ZKMetadataProvider.getInstanceZKMetadata介绍

暂无

代码示例

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

/**
 * Get the instance Zookeeper metadata for the given instance Id.
 *
 * @param instanceId Instance Id
 * @return Instance Zookeeper metadata, or null if not found
 */
@Nullable
public InstanceZKMetadata getInstanceZKMetadata(@Nonnull String instanceId) {
 return ZKMetadataProvider.getInstanceZKMetadata(_propertyStore, instanceId);
}

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

InstanceZKMetadata instanceZKMetadata = ZKMetadataProvider.getInstanceZKMetadata(_propertyStore, _instanceId);

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

private static void setupInstanceConfigForHighLevelConsumer(String realtimeTableName, int numDataInstances,
  int numDataReplicas, Map<String, String> streamConfig, ZkHelixPropertyStore<ZNRecord> zkHelixPropertyStore,
  List<String> instanceList) {
 int numInstancesPerReplica = numDataInstances / numDataReplicas;
 int partitionId = 0;
 int replicaId = 0;
 String groupId = getGroupIdFromRealtimeDataTable(realtimeTableName, streamConfig);
 for (int i = 0; i < numInstancesPerReplica * numDataReplicas; ++i) {
  String instance = instanceList.get(i);
  InstanceZKMetadata instanceZKMetadata = ZKMetadataProvider.getInstanceZKMetadata(zkHelixPropertyStore, instance);
  if (instanceZKMetadata == null) {
   instanceZKMetadata = new InstanceZKMetadata();
   String[] instanceConfigs = instance.split("_");
   assert (instanceConfigs.length == 3);
   instanceZKMetadata.setInstanceType(instanceConfigs[0]);
   instanceZKMetadata.setInstanceName(instanceConfigs[1]);
   instanceZKMetadata.setInstancePort(Integer.parseInt(instanceConfigs[2]));
  }
  instanceZKMetadata.setGroupId(realtimeTableName, groupId + "_" + replicaId);
  instanceZKMetadata.setPartition(realtimeTableName, Integer.toString(partitionId));
  partitionId = (partitionId + 1) % numInstancesPerReplica;
  if (partitionId == 0) {
   replicaId++;
  }
  ZKMetadataProvider.setInstanceZKMetadata(zkHelixPropertyStore, instanceZKMetadata);
 }
}

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

public void deleteRealtimeTable(String tableName) {
 String realtimeTableName = TableNameBuilder.REALTIME.tableNameWithType(tableName);
 // Remove the table from brokerResource
 HelixHelper.removeResourceFromBrokerIdealState(_helixZkManager, realtimeTableName);
 // Cache the state and drop the table
 Set<String> instancesForTable = null;
 if (_helixAdmin.getResourcesInCluster(_helixClusterName).contains(realtimeTableName)) {
  instancesForTable = getAllInstancesForTable(realtimeTableName);
  _helixAdmin.dropResource(_helixClusterName, realtimeTableName);
 }
 // Remove all segments for the table
 _segmentDeletionManager.removeSegmentsFromStore(realtimeTableName, getSegmentsFor(realtimeTableName));
 ZKMetadataProvider.removeResourceSegmentsFromPropertyStore(_propertyStore, realtimeTableName);
 // Remove table config
 ZKMetadataProvider.removeResourceConfigFromPropertyStore(_propertyStore, realtimeTableName);
 // Remove groupId/PartitionId mapping for HLC table
 if (instancesForTable != null) {
  for (String instance : instancesForTable) {
   InstanceZKMetadata instanceZKMetadata = ZKMetadataProvider.getInstanceZKMetadata(_propertyStore, instance);
   if (instanceZKMetadata != null) {
    instanceZKMetadata.removeResource(realtimeTableName);
    ZKMetadataProvider.setInstanceZKMetadata(_propertyStore, instanceZKMetadata);
   }
  }
 }
}

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