gpt4 book ai didi

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

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

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

ZkHelixPropertyStore.<init>介绍

暂无

代码示例

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

/**
 * State store that stores instances of {@link State}s in a ZooKeeper-backed {@link HelixPropertyStore}
 * storeRootDir will be created when the first entry is written if it does not exist
 * @param connectString ZooKeeper connect string
 * @param storeRootDir The root directory for the state store
 * @param compressedValues should values be compressed for storage?
 * @param stateClass The type of state being stored
 * @throws IOException
 */
public ZkStateStore(String connectString, String storeRootDir, boolean compressedValues, Class<T> stateClass)
  throws IOException {
 this.compressedValues = compressedValues;
 this.stateClass = stateClass;
 ZkSerializer serializer = new ByteArraySerializer();
 propStore = new ZkHelixPropertyStore<byte[]>(connectString, serializer, storeRootDir);
}

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

public AutoAddInvertedIndex(@Nonnull String zkAddress, @Nonnull String clusterName, @Nonnull String controllerAddress,
  @Nonnull String brokerAddress, @Nonnull Strategy strategy, @Nonnull Mode mode) {
 _clusterName = clusterName;
 _controllerAddress = controllerAddress;
 _brokerAddress = brokerAddress;
 _helixAdmin = new ZKHelixAdmin(zkAddress);
 _propertyStore = new ZkHelixPropertyStore<>(zkAddress, new ZNRecordSerializer(),
   PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, clusterName));
 _strategy = strategy;
 _mode = mode;
}

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

private void init() {
 LOGGER.info("Trying to connect to " + _zkAddress + " cluster " + _clusterName);
 _helixAdmin = new ZKHelixAdmin(_zkAddress);
 ZNRecordSerializer serializer = new ZNRecordSerializer();
 String path = PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, _clusterName);
 _propertyStore = new ZkHelixPropertyStore<>(_zkAddress, serializer, path);
}

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

public TableRetentionValidator(@Nonnull String zkAddress, @Nonnull String clusterName) {
 _clusterName = clusterName;
 _helixAdmin = new ZKHelixAdmin(zkAddress);
 _propertyStore = new ZkHelixPropertyStore<>(zkAddress, new ZNRecordSerializer(),
   PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, clusterName));
}

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

@Override
public boolean execute()
  throws Exception {
 if (!_validateTableConfig && !_validateSchema) {
  throw new RuntimeException("Need to specify at least one of -schema and -tableConfig");
 }
 LOGGER.info("Connecting to Zookeeper: {}, cluster: ", _zkAddress, _clusterName);
 ZNRecordSerializer serializer = new ZNRecordSerializer();
 String path = PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, _clusterName);
 _helixPropertyStore = new ZkHelixPropertyStore<>(_zkAddress, serializer, path);
 LOGGER.info("\n\n-------------------- Starting Validation --------------------");
 if (_validateTableConfig) {
  validateTableConfig();
 }
 if (_validateSchema) {
  validateSchema();
 }
 return true;
}

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

private TableConfig getTableConfig(String tableName)
  throws IOException {
 ZNRecordSerializer serializer = new ZNRecordSerializer();
 String path = PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, zkPath);
 ZkHelixPropertyStore<ZNRecord> propertyStore = new ZkHelixPropertyStore<>(zkHost, serializer, path);
 ZNRecord tcZnRecord = propertyStore.get("/CONFIGS/TABLE/" + tableName, null, 0);
 TableConfig tableConfig = TableConfig.fromZnRecord(tcZnRecord);
 LOGGER.debug("Loaded table config");
 return tableConfig;
}

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

public PinotZKChanger(String zkAddress, String clusterName) {
 this.clusterName = clusterName;
 helixAdmin = new ZKHelixAdmin(zkAddress);
 helixManager = HelixManagerFactory
   .getZKHelixManager(clusterName, "PinotNumReplicaChanger", InstanceType.ADMINISTRATOR, zkAddress);
 try {
  helixManager.connect();
 } catch (Exception e) {
  throw new RuntimeException(e);
 }
 ZNRecordSerializer serializer = new ZNRecordSerializer();
 String path = PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, clusterName);
 propertyStore = new ZkHelixPropertyStore<>(zkAddress, serializer, path);
}

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

void setPropertyStore(String clusterName) {
 _propertyStore =
   new ZkHelixPropertyStore<>(new ZkBaseDataAccessor<ZNRecord>(_zkclient), "/" + clusterName + "/PROPERTYSTORE",
     null);
}

代码示例来源: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

@BeforeTest
public void beforeTest() {
 _zookeeperInstance = ZkStarter.startLocalZkServer();
 _zkClient = new ZkClient(StringUtil.join("/", StringUtils.chomp(ZkStarter.DEFAULT_ZK_STR, "/")),
   ZkClient.DEFAULT_SESSION_TIMEOUT, ZkClient.DEFAULT_CONNECTION_TIMEOUT, new ZNRecordSerializer());
 String helixClusterName = "TestTimeBoundaryService";
 _zkClient.deleteRecursive("/" + helixClusterName + "/PROPERTYSTORE");
 _zkClient.createPersistent("/" + helixClusterName + "/PROPERTYSTORE", true);
 _propertyStore = new ZkHelixPropertyStore<>(new ZkBaseDataAccessor<ZNRecord>(_zkClient),
   "/" + helixClusterName + "/PROPERTYSTORE", null);
}

代码示例来源:origin: uber/chaperone

public static ZkHelixPropertyStore<ZNRecord> getZkPropertyStore(HelixManager helixManager,
  String clusterName) {
 ZkBaseDataAccessor<ZNRecord> baseAccessor =
   (ZkBaseDataAccessor<ZNRecord>) helixManager.getHelixDataAccessor().getBaseDataAccessor();
 String propertyStorePath = PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, clusterName);
 ZkHelixPropertyStore<ZNRecord> propertyStore = new ZkHelixPropertyStore<ZNRecord>(baseAccessor,
   propertyStorePath, Arrays.asList(propertyStorePath));
 return propertyStore;
}

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

public AutoFallbackPropertyStore(ZkBaseDataAccessor<T> accessor, String root, String fallbackRoot) {
 super(accessor, root, null);
 if (accessor.exists(fallbackRoot, 0)) {
  _fallbackStore = new ZkHelixPropertyStore<T>(accessor, fallbackRoot, null);
 } else {
  LOG.info("fallbackRoot: " + fallbackRoot
    + " doesn't exist, skip creating fallback property store");
  _fallbackStore = null;
 }
}

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

public AutoFallbackPropertyStore(ZkBaseDataAccessor<T> accessor, String root, String fallbackRoot) {
 super(accessor, root, null);
 if (accessor.exists(fallbackRoot, 0)) {
  _fallbackStore = new ZkHelixPropertyStore<T>(accessor, fallbackRoot, null);
 } else {
  LOG.info("fallbackRoot: " + fallbackRoot
    + " doesn't exist, skip creating fallback property store");
  _fallbackStore = null;
 }
}

代码示例来源:origin: uber/uReplicator

public static ZkHelixPropertyStore<ZNRecord> getZkPropertyStore(HelixManager helixManager,
  String clusterName) {
 ZkBaseDataAccessor<ZNRecord> baseAccessor =
   (ZkBaseDataAccessor<ZNRecord>) helixManager.getHelixDataAccessor().getBaseDataAccessor();
 String propertyStorePath = PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, clusterName);
 ZkHelixPropertyStore<ZNRecord> propertyStore = new ZkHelixPropertyStore<ZNRecord>(baseAccessor,
   propertyStorePath, Arrays.asList(propertyStorePath));
 return propertyStore;
}

代码示例来源:origin: uber/uReplicator

public static ZkHelixPropertyStore<ZNRecord> getZkPropertyStore(HelixManager helixManager,
  String clusterName) {
 ZkBaseDataAccessor<ZNRecord> baseAccessor =
   (ZkBaseDataAccessor<ZNRecord>) helixManager.getHelixDataAccessor().getBaseDataAccessor();
 String propertyStorePath = PropertyPathConfig.getPath(PropertyType.PROPERTYSTORE, clusterName);
 ZkHelixPropertyStore<ZNRecord> propertyStore = new ZkHelixPropertyStore<ZNRecord>(baseAccessor,
   propertyStorePath, Arrays.asList(propertyStorePath));
 return propertyStore;
}

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

public TaskDriver(HelixZkClient client, ZkBaseDataAccessor<ZNRecord> baseAccessor, String clusterName) {
 this(new ZKHelixAdmin(client), new ZKHelixDataAccessor(clusterName, baseAccessor),
   new ZkHelixPropertyStore<>(baseAccessor,
     PropertyPathBuilder.propertyStore(clusterName), null), clusterName);
}

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

public TaskDriver(ZkClient client, ZkBaseDataAccessor<ZNRecord> baseAccessor, String clusterName) {
 this(new ZKHelixAdmin(client), new ZKHelixDataAccessor(clusterName, baseAccessor),
   new ZkHelixPropertyStore<ZNRecord>(baseAccessor,
     PropertyPathBuilder.propertyStore(clusterName), null), clusterName);
}

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

/**
 * @param zkAddr
 * @param clusterName
 * @param dimensionName Identify of the capacity attribute. For example memory, CPU.
 *                      Need to match resource weight dimension.
 */
public ZkBasedCapacityProvider(String zkAddr, String clusterName, String dimensionName) {
 this(new ZkHelixPropertyStore<ZNRecord>(zkAddr, new ZNRecordSerializer(),
   PropertyPathBuilder.propertyStore(clusterName)), dimensionName);
}

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

/**
 * @param zkAddr
 * @param clusterName
 * @param dimensionName Identify of the capacity attribute. For example memory, CPU.
 *                      Need to match resource weight dimension.
 */
public ZkBasedCapacityProvider(String zkAddr, String clusterName, String dimensionName) {
 this(new ZkHelixPropertyStore<ZNRecord>(zkAddr, new ZNRecordSerializer(),
   PropertyPathBuilder.propertyStore(clusterName)), dimensionName);
}

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

/**
 * @param zkAddr
 * @param clusterName
 * @param dimensionName Identify of the capacity attribute. For example memory, CPU.
 *                      Need to match resource weight dimension.
 */
public ZkBasedPartitionWeightProvider(String zkAddr, String clusterName, String dimensionName) {
 this(new ZkHelixPropertyStore<ZNRecord>(zkAddr, new ZNRecordSerializer(),
   PropertyPathBuilder.propertyStore(clusterName)), dimensionName);
}

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