gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-15 08:18:49 29 4
gpt4 key购买 nike

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

ZkHelixPropertyStore.create介绍

暂无

代码示例

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

private static void initPropertyStorePath(String helixClusterName, String zkPath) {
 String propertyStorePath = PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, helixClusterName);
 ZkHelixPropertyStore<ZNRecord> propertyStore =
   new ZkHelixPropertyStore<ZNRecord>(zkPath, new ZNRecordSerializer(), propertyStorePath);
 propertyStore.create("/CONFIGS", new ZNRecord(""), AccessOption.PERSISTENT);
 propertyStore.create("/CONFIGS/CLUSTER", new ZNRecord(""), AccessOption.PERSISTENT);
 propertyStore.create("/CONFIGS/TABLE", new ZNRecord(""), AccessOption.PERSISTENT);
 propertyStore.create("/CONFIGS/INSTANCE", new ZNRecord(""), AccessOption.PERSISTENT);
 propertyStore.create("/SCHEMAS", new ZNRecord(""), AccessOption.PERSISTENT);
 propertyStore.create("/SEGMENTS", new ZNRecord(""), AccessOption.PERSISTENT);
}

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

private void createHelixEntriesForHighLevelConsumer(TableConfig config, String realtimeTableName,
  IdealState idealState) {
 if (idealState == null) {
  idealState = PinotTableIdealStateBuilder
    .buildInitialHighLevelRealtimeIdealStateFor(realtimeTableName, config, _helixZkManager, _propertyStore,
      _enableBatchMessageMode);
  LOGGER.info("Adding helix resource with empty HLC IdealState for {}", realtimeTableName);
  _helixAdmin.addResource(_helixClusterName, realtimeTableName, idealState);
 } else {
  // TODO jfim: We get in this block if we're trying to add a HLC or it already exists. If it doesn't already exist, we need to set instance configs properly (which is done in buildInitialHighLevelRealtimeIdealState, surprisingly enough). For now, do nothing.
  LOGGER.info("Not reconfiguring HLC for table {}", realtimeTableName);
 }
 LOGGER.info("Successfully created empty ideal state for  high level consumer for {} ", realtimeTableName);
 // Finally, create the propertystore entry that will trigger watchers to create segments
 String tablePropertyStorePath = ZKMetadataProvider.constructPropertyStorePathForResource(realtimeTableName);
 if (!_propertyStore.exists(tablePropertyStorePath, AccessOption.PERSISTENT)) {
  _propertyStore.create(tablePropertyStorePath, new ZNRecord(realtimeTableName), AccessOption.PERSISTENT);
 }
}

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

.setOfflineTableConfig(_propertyStore, tableNameWithType, TableConfig.toZnRecord(tableConfig));
_propertyStore.create(ZKMetadataProvider.constructPropertyStorePathForResource(tableNameWithType),
  new ZNRecord(tableNameWithType), AccessOption.PERSISTENT);

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

@Override
public boolean update(String path, DataUpdater<T> updater, int options) {
 if (_fallbackStore == null) {
  return super.update(path, updater, options);
 } else {
  Stat stat = super.getStat(path, options);
  if (stat == null) {
   // create znode at new location with fallback-value
   T fallbackValue = _fallbackStore.get(path, null, options);
   boolean succeed = super.create(path, fallbackValue, AccessOption.PERSISTENT);
   if (!succeed) {
    LOG.error("Can't update " + path + " since there are concurrent updates");
    return false;
   }
  }
  return super.update(path, updater, options);
 }
}

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

@Override
public boolean update(String path, DataUpdater<T> updater, int options) {
 if (_fallbackStore == null) {
  return super.update(path, updater, options);
 } else {
  Stat stat = super.getStat(path, options);
  if (stat == null) {
   // create znode at new location with fallback-value
   T fallbackValue = _fallbackStore.get(path, null, options);
   boolean succeed = super.create(path, fallbackValue, AccessOption.PERSISTENT);
   if (!succeed) {
    LOG.error("Can't update " + path + " since there are concurrent updates");
    return false;
   }
  }
  return super.update(path, updater, options);
 }
}

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