gpt4 book ai didi

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

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

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

ZkHelixPropertyStore.set介绍

暂无

代码示例

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

public void set(String name, ZNRecord record) {
 propertyStore.set(pathPrefix + "/" + name, record, AccessOption.PERSISTENT);
}

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

protected boolean writeSegmentToPropertyStore(String znodePath, ZNRecord znRecord, final String realtimeTableName,
  int expectedVersion) {
 boolean success = _propertyStore.set(znodePath, znRecord, expectedVersion, AccessOption.PERSISTENT);
 if (!success) {
  LOGGER
    .error("Failed to write segment to property store at {} for table {}. Expected zookeeper version number: {}",
      znodePath, realtimeTableName, expectedVersion);
  return false;
 }
 return success;
}

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

protected boolean writeSegmentToPropertyStore(String znodePath, ZNRecord znRecord, final String realtimeTableName) {
 boolean success = _propertyStore.set(znodePath, znRecord, AccessOption.PERSISTENT);
 if (!success) {
  LOGGER.error("Failed to write segment to property store at {} for table {}.", znodePath, realtimeTableName);
 }
 return success;
}

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

public static void setRealtimeTableConfig(ZkHelixPropertyStore<ZNRecord> propertyStore, String realtimeTableName,
  ZNRecord znRecord) {
 propertyStore
   .set(constructPropertyStorePathForResourceConfig(realtimeTableName), znRecord, AccessOption.PERSISTENT);
}

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

public static void setOfflineTableConfig(ZkHelixPropertyStore<ZNRecord> propertyStore, String offlineTableName,
  ZNRecord znRecord) {
 propertyStore.set(constructPropertyStorePathForResourceConfig(offlineTableName), znRecord, AccessOption.PERSISTENT);
}

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

/**
  * Write the segment merge lineage to the property store
  *
  * @param propertyStore a property store
  * @param segmentMergeLineage a segment merge lineage
  * @return true if update is successful. false otherwise.
  */
 public static boolean writeSegmentMergeLineage(ZkHelixPropertyStore<ZNRecord> propertyStore,
   SegmentMergeLineage segmentMergeLineage, int expectedVersion) {
  String tableNameWithType = segmentMergeLineage.getTableName();
  String path = ZKMetadataProvider.constructPropertyStorePathForSegmentMergeLineage(tableNameWithType);
  return propertyStore.set(path, segmentMergeLineage.toZNRecord(), expectedVersion, AccessOption.PERSISTENT);
 }
}

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

public static void setInstanceZKMetadata(ZkHelixPropertyStore<ZNRecord> propertyStore,
  InstanceZKMetadata instanceZKMetadata) {
 ZNRecord znRecord = instanceZKMetadata.toZNRecord();
 propertyStore.set(StringUtil.join("/", PROPERTYSTORE_INSTANCE_CONFIGS_PREFIX, instanceZKMetadata.getId()), znRecord,
   AccessOption.PERSISTENT);
}

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

public static boolean setOfflineSegmentZKMetadata(ZkHelixPropertyStore<ZNRecord> propertyStore,
  OfflineSegmentZKMetadata offlineSegmentZKMetadata, int expectedVersion) {
 // NOTE: Helix will throw ZkBadVersionException if version does not match
 try {
  return propertyStore.set(constructPropertyStorePathForSegment(
    TableNameBuilder.OFFLINE.tableNameWithType(offlineSegmentZKMetadata.getTableName()),
    offlineSegmentZKMetadata.getSegmentName()), offlineSegmentZKMetadata.toZNRecord(), expectedVersion,
    AccessOption.PERSISTENT);
 } catch (ZkBadVersionException e) {
  return false;
 }
}

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

public static boolean setOfflineSegmentZKMetadata(ZkHelixPropertyStore<ZNRecord> propertyStore,
  OfflineSegmentZKMetadata offlineSegmentZKMetadata) {
 return propertyStore.set(constructPropertyStorePathForSegment(
   TableNameBuilder.OFFLINE.tableNameWithType(offlineSegmentZKMetadata.getTableName()),
   offlineSegmentZKMetadata.getSegmentName()), offlineSegmentZKMetadata.toZNRecord(), AccessOption.PERSISTENT);
}

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

public static boolean setRealtimeSegmentZKMetadata(ZkHelixPropertyStore<ZNRecord> propertyStore,
  RealtimeSegmentZKMetadata realtimeSegmentZKMetadata) {
 return propertyStore.set(constructPropertyStorePathForSegment(
   TableNameBuilder.REALTIME.tableNameWithType(realtimeSegmentZKMetadata.getTableName()),
   realtimeSegmentZKMetadata.getSegmentName()), realtimeSegmentZKMetadata.toZNRecord(), AccessOption.PERSISTENT);
}

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

/**
 * Write the replica group partition assignment to property store
 *
 * @param partitionAssignment a replica group partition assignment
 */
public void writeReplicaGroupPartitionAssignment(ReplicaGroupPartitionAssignment partitionAssignment) {
 String tableNameWithType = partitionAssignment.getTableName();
 ZNRecord znRecord = new ZNRecord(tableNameWithType);
 znRecord.setListFields(partitionAssignment.getPartitionToInstances());
 String path = ZKMetadataProvider.constructPropertyStorePathForInstancePartitions(tableNameWithType);
 _propertyStore.set(path, znRecord, AccessOption.PERSISTENT);
}

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

public static void setClusterTenantIsolationEnabled(ZkHelixPropertyStore<ZNRecord> propertyStore,
  boolean isSingleTenantCluster) {
 final ZNRecord znRecord;
 final String path = constructPropertyStorePathForControllerConfig(CLUSTER_TENANT_ISOLATION_ENABLED_KEY);
 if (!propertyStore.exists(path, AccessOption.PERSISTENT)) {
  znRecord = new ZNRecord(CLUSTER_TENANT_ISOLATION_ENABLED_KEY);
 } else {
  znRecord = propertyStore.get(path, null, AccessOption.PERSISTENT);
 }
 znRecord.setBooleanField(CLUSTER_TENANT_ISOLATION_ENABLED_KEY, isSingleTenantCluster);
 propertyStore.set(path, znRecord, AccessOption.PERSISTENT);
}

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

/**
 * Set the runtime context of a single workflow
 * @param manager a connection to Helix
 * @param workflow the name of the workflow
 * @param workflowContext the up-to-date {@link WorkflowContext} for the workflow
 */
protected static void setWorkflowContext(HelixManager manager, String workflow,
  WorkflowContext workflowContext) {
 manager.getHelixPropertyStore().set(
   Joiner.on("/").join(TaskConstants.REBALANCER_CONTEXT_ROOT, workflow, CONTEXT_NODE),
   workflowContext.getRecord(), AccessOption.PERSISTENT);
}

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

/**
 * Set the last task assignment for a given job
 * @param resourceName the name of the job
 * @param ra {@link ResourceAssignment} containing the task assignment
 */
private void setPrevResourceAssignment(String resourceName, ResourceAssignment ra) {
 _manager.getHelixPropertyStore().set(
   Joiner.on("/").join(TaskConstants.REBALANCER_CONTEXT_ROOT, resourceName, TaskConstants.PREV_RA_NODE),
   ra.getRecord(), AccessOption.PERSISTENT);
}

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

/**
 * Set the last task assignment for a given job
 * @param manager a connection to Helix
 * @param resourceName the name of the job
 * @param ra {@link ResourceAssignment} containing the task assignment
 */
public void setPrevResourceAssignment(HelixManager manager, String resourceName,
  ResourceAssignment ra) {
 manager.getHelixPropertyStore().set(
   Joiner.on("/").join(TaskConstants.REBALANCER_CONTEXT_ROOT, resourceName, PREV_RA_NODE),
   ra.getRecord(), AccessOption.PERSISTENT);
}

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

/**
 * Set the runtime context of a single workflow
 * @param manager a connection to Helix
 * @param workflow the name of the workflow
 * @param workflowContext the up-to-date {@link WorkflowContext} for the workflow
 */
protected static void setWorkflowContext(HelixManager manager, String workflow,
  WorkflowContext workflowContext) {
 manager.getHelixPropertyStore().set(
   Joiner.on("/").join(TaskConstants.REBALANCER_CONTEXT_ROOT, workflow, CONTEXT_NODE),
   workflowContext.getRecord(), AccessOption.PERSISTENT);
}

代码示例来源:origin: com.linkedin.gobblin/gobblin-cluster

/**
 * Set the last task assignment for a given job
 *
 * @param resourceName the name of the job
 * @param ra           {@link ResourceAssignment} containing the task assignment
 */
private void setPrevResourceAssignment(String resourceName,
  ResourceAssignment ra) {
 _manager.getHelixPropertyStore()
   .set(Joiner.on("/").join(TaskConstants.REBALANCER_CONTEXT_ROOT, resourceName, PREV_RA_NODE),
     ra.getRecord(), AccessOption.PERSISTENT);
}

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

/**
 * @return True if the capacity information is successfully wrote to ZK.
 */
public boolean persistCapacity() {
 if (_capacity.isValid()) {
  return _propertyStore.set(_dimensionPath, _capacity.getRecord(), AccessOption.PERSISTENT);
 } else {
  throw new HelixException("Invalid ParticipantCapacity: " + _capacity.getRecord().toString());
 }
}

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

/**
 * @return True if the capacity information is successfully wrote to ZK.
 */
public boolean persistCapacity() {
 if (_capacity.isValid()) {
  return _propertyStore.set(_dimensionPath, _capacity.getRecord(), AccessOption.PERSISTENT);
 } else {
  throw new HelixException("Invalid ParticipantCapacity: " + _capacity.getRecord().toString());
 }
}

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

/**
 * @return True if the weight information is successfully wrote to ZK.
 */
public boolean persistWeights() {
 if (_weights.isValid()) {
  return _propertyStore.set(_dimensionPath, _weights.getRecord(), AccessOption.PERSISTENT);
 } else {
  throw new HelixException("Invalid ParticipantCapacity: " + _weights.getRecord().toString());
 }
}

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