gpt4 book ai didi

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

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

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

ZKMetadataProvider.setOfflineSegmentZKMetadata介绍

暂无

代码示例

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

public boolean updateZkMetadata(@Nonnull OfflineSegmentZKMetadata segmentMetadata, int expectedVersion) {
 return ZKMetadataProvider.setOfflineSegmentZKMetadata(_propertyStore, segmentMetadata, expectedVersion);
}

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

public boolean updateZkMetadata(@Nonnull OfflineSegmentZKMetadata segmentMetadata) {
 return ZKMetadataProvider.setOfflineSegmentZKMetadata(_propertyStore, segmentMetadata);
}

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

public void addNewSegment(@Nonnull SegmentMetadata segmentMetadata, @Nonnull String downloadUrl, String crypter) {
 String segmentName = segmentMetadata.getName();
 String offlineTableName = TableNameBuilder.OFFLINE.tableNameWithType(segmentMetadata.getTableName());
 // NOTE: must first set the segment ZK metadata before trying to update ideal state because server will need the
 // segment ZK metadata to download and load the segment
 OfflineSegmentZKMetadata offlineSegmentZKMetadata = new OfflineSegmentZKMetadata();
 offlineSegmentZKMetadata = ZKMetadataUtils.updateSegmentMetadata(offlineSegmentZKMetadata, segmentMetadata);
 offlineSegmentZKMetadata.setDownloadUrl(downloadUrl);
 offlineSegmentZKMetadata.setCrypterName(crypter);
 offlineSegmentZKMetadata.setPushTime(System.currentTimeMillis());
 if (!ZKMetadataProvider.setOfflineSegmentZKMetadata(_propertyStore, offlineSegmentZKMetadata)) {
  throw new RuntimeException(
    "Failed to set segment ZK metadata for table: " + offlineTableName + ", segment: " + segmentName);
 }
 LOGGER.info("Added segment: {} of table: {} to property store", segmentName, offlineTableName);
 addNewOfflineSegment(segmentMetadata);
 LOGGER.info("Added segment: {} of table: {} to ideal state", segmentName, offlineTableName);
}

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

if (!ZKMetadataProvider.setOfflineSegmentZKMetadata(_propertyStore, offlineSegmentZKMetadata)) {
 throw new RuntimeException(
   "Failed to update ZK metadata for segment: " + segmentName + " of table: " + offlineTableName);

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

offlineSegmentZKMetadata.setTableName(OFFLINE_TABLE_NAME);
offlineSegmentZKMetadata.setSegmentName(segmentName);
ZKMetadataProvider.setOfflineSegmentZKMetadata(_propertyStore, offlineSegmentZKMetadata);
List<OfflineSegmentZKMetadata> retrievedMetadataList =
  _helixResourceManager.getOfflineSegmentMetadata(OFFLINE_TABLE_NAME);

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

private void addingSegmentsToPropertyStore(int numSegments, String tableName) {
 for (int i = 0; i < numSegments; ++i) {
  OfflineSegmentZKMetadata offlineSegmentZKMetadata = new OfflineSegmentZKMetadata();
  offlineSegmentZKMetadata.setSegmentName(tableName + "_" + System.currentTimeMillis() + "_" + i);
  offlineSegmentZKMetadata.setTableName(tableName);
  offlineSegmentZKMetadata.setStartTime(i - 1);
  offlineSegmentZKMetadata.setEndTime(i);
  offlineSegmentZKMetadata.setTimeUnit(TimeUnit.DAYS);
  offlineSegmentZKMetadata.setCrc(-1);
  offlineSegmentZKMetadata.setCreationTime(-1);
  offlineSegmentZKMetadata.setIndexVersion("0");
  offlineSegmentZKMetadata.setPushTime(i + 5);
  offlineSegmentZKMetadata.setSegmentType(SegmentType.OFFLINE);
  ZKMetadataProvider.setOfflineSegmentZKMetadata(_propertyStore, offlineSegmentZKMetadata);
 }
}

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