Java Code Examples for org.apache.helix.store.zk.ZkHelixPropertyStore#set()

The following examples show how to use org.apache.helix.store.zk.ZkHelixPropertyStore#set() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ZKMetadataProvider.java    From incubator-pinot with Apache License 2.0 5 votes vote down vote up
public static boolean setOfflineSegmentZKMetadata(ZkHelixPropertyStore<ZNRecord> propertyStore,
    String offlineTableName, OfflineSegmentZKMetadata offlineSegmentZKMetadata, int expectedVersion) {
  // NOTE: Helix will throw ZkBadVersionException if version does not match
  try {
    return propertyStore
        .set(constructPropertyStorePathForSegment(offlineTableName, offlineSegmentZKMetadata.getSegmentName()),
            offlineSegmentZKMetadata.toZNRecord(), expectedVersion, AccessOption.PERSISTENT);
  } catch (ZkBadVersionException e) {
    return false;
  }
}
 
Example 2
Source File: ZKMetadataProvider.java    From incubator-pinot with Apache License 2.0 4 votes vote down vote up
public static void setRealtimeTableConfig(ZkHelixPropertyStore<ZNRecord> propertyStore, String realtimeTableName,
    ZNRecord znRecord) {
  propertyStore
      .set(constructPropertyStorePathForResourceConfig(realtimeTableName), znRecord, AccessOption.PERSISTENT);
}
 
Example 3
Source File: ZKMetadataProvider.java    From incubator-pinot with Apache License 2.0 4 votes vote down vote up
public static void setOfflineTableConfig(ZkHelixPropertyStore<ZNRecord> propertyStore, String offlineTableName,
    ZNRecord znRecord) {
  propertyStore.set(constructPropertyStorePathForResourceConfig(offlineTableName), znRecord, AccessOption.PERSISTENT);
}
 
Example 4
Source File: ZKMetadataProvider.java    From incubator-pinot with Apache License 2.0 4 votes vote down vote up
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);
}
 
Example 5
Source File: ZKMetadataProvider.java    From incubator-pinot with Apache License 2.0 4 votes vote down vote up
public static boolean setOfflineSegmentZKMetadata(ZkHelixPropertyStore<ZNRecord> propertyStore,
    String offlineTableName, OfflineSegmentZKMetadata offlineSegmentZKMetadata) {
  return propertyStore
      .set(constructPropertyStorePathForSegment(offlineTableName, offlineSegmentZKMetadata.getSegmentName()),
          offlineSegmentZKMetadata.toZNRecord(), AccessOption.PERSISTENT);
}
 
Example 6
Source File: ZKMetadataProvider.java    From incubator-pinot with Apache License 2.0 4 votes vote down vote up
public static boolean setRealtimeSegmentZKMetadata(ZkHelixPropertyStore<ZNRecord> propertyStore,
    String realtimeTableName, RealtimeSegmentZKMetadata realtimeSegmentZKMetadata) {
  return propertyStore
      .set(constructPropertyStorePathForSegment(realtimeTableName, realtimeSegmentZKMetadata.getSegmentName()),
          realtimeSegmentZKMetadata.toZNRecord(), AccessOption.PERSISTENT);
}
 
Example 7
Source File: ZKMetadataProvider.java    From incubator-pinot with Apache License 2.0 4 votes vote down vote up
public static void setSchema(ZkHelixPropertyStore<ZNRecord> propertyStore, Schema schema) {
  propertyStore.set(constructPropertyStorePathForSchema(schema.getSchemaName()), SchemaUtils.toZNRecord(schema),
      AccessOption.PERSISTENT);
}
 
Example 8
Source File: SegmentLineageAccessHelper.java    From incubator-pinot with Apache License 2.0 3 votes vote down vote up
/**
 * Write the segment lineage to the property store
 *
 * @param propertyStore a property store
 * @param segmentLineage a segment lineage
 * @return true if update is successful. false otherwise.
 */
public static boolean writeSegmentLineage(ZkHelixPropertyStore<ZNRecord> propertyStore,
    SegmentLineage segmentLineage, int expectedVersion) {
  String tableNameWithType = segmentLineage.getTableNameWithType();
  String path = ZKMetadataProvider.constructPropertyStorePathForSegmentLineage(tableNameWithType);
  return propertyStore.set(path, segmentLineage.toZNRecord(), expectedVersion, AccessOption.PERSISTENT);
}