gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-13 21:10:03 29 4
gpt4 key购买 nike

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

ZkBaseDataAccessor.<init>介绍

暂无

代码示例

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

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

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

zkClient.setZkSerializer(new ZNRecordSerializer());
HelixDataAccessor accessor =
  new ZKHelixDataAccessor(helixClusterName, new ZkBaseDataAccessor<ZNRecord>(zkClient));
PropertyKey.Builder keyBuilder = accessor.keyBuilder();
accessor.setProperty(keyBuilder.stateModelDef(segmentStateModelName), newStateModelDef);

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

LOGGER.info("Connecting to Zookeeper at: {}", _zkAddress);
zkClient.waitUntilConnected(CommonConstants.Helix.ZkClient.DEFAULT_CONNECT_TIMEOUT_SEC, TimeUnit.SECONDS);
ZkBaseDataAccessor<ZNRecord> baseDataAccessor = new ZkBaseDataAccessor<>(zkClient);
ZKHelixDataAccessor zkHelixDataAccessor = new ZKHelixDataAccessor(_clusterName, baseDataAccessor);
PropertyKey property = zkHelixDataAccessor.keyBuilder().liveInstances();

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

@Override
public boolean verify() {
 try {
  HelixDataAccessor accessor =
    new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(zkClient));
  return verifyBestPossAndExtView(accessor, errStates, clusterName, resources);
 } catch (Exception e) {
  LOG.error("exception in verification", e);
 }
 return false;
}

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

@Override
public boolean verify() {
 try {
  ZKHelixDataAccessor accessor =
    new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(zkClient));
  return verifyMasterNbInExtView(accessor);
 } catch (Exception e) {
  LOG.error("exception in verification", e);
 }
 return false;
}

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

public ClusterVerifier(ZkClient zkclient, String clusterName) {
 _zkclient = zkclient;
 _clusterName = clusterName;
 _accessor = new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(zkclient));
 _keyBuilder = _accessor.keyBuilder();
}

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

@Override
public boolean verify() {
 try {
  HelixDataAccessor accessor =
    new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(zkClient));
  return verifyBestPossAndExtView(accessor, errStates, clusterName, resources);
 } catch (Exception e) {
  LOG.error("exception in verification", e);
 }
 return false;
}

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

public ZkHelixClusterVerifier(ZkClient zkClient, String clusterName) {
 if (zkClient == null || clusterName == null) {
  throw new IllegalArgumentException("requires zkClient|clusterName");
 }
 _zkClient = zkClient;
 _clusterName = clusterName;
 _accessor = new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
 _keyBuilder = _accessor.keyBuilder();
}

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

public ZkHelixClusterVerifier(String zkAddr, String clusterName) {
 if (zkAddr == null || clusterName == null) {
  throw new IllegalArgumentException("requires zkAddr|clusterName");
 }
 _zkClient = ZKClientPool.getZkClient(zkAddr);
 _clusterName = clusterName;
 _accessor = new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
 _keyBuilder = _accessor.keyBuilder();
}

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

@Override
public IdealState getResourceIdealState(String clusterName, String resourceName) {
 HelixDataAccessor accessor =
   new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
 Builder keyBuilder = accessor.keyBuilder();
 return accessor.getProperty(keyBuilder.idealStates(resourceName));
}

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

@Override
public ExternalView getResourceExternalView(String clusterName, String resourceName) {
 HelixDataAccessor accessor =
   new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
 Builder keyBuilder = accessor.keyBuilder();
 return accessor.getProperty(keyBuilder.externalView(resourceName));
}

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

@Override
public StateModelDefinition getStateModelDef(String clusterName,
  String stateModelName) {
 HelixDataAccessor accessor =
   new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
 Builder keyBuilder = accessor.keyBuilder();
 return accessor.getProperty(keyBuilder.stateModelDef(stateModelName));
}

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

@Override
public IdealState getResourceIdealState(String clusterName, String resourceName) {
 HelixDataAccessor accessor =
   new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
 Builder keyBuilder = accessor.keyBuilder();
 return accessor.getProperty(keyBuilder.idealStates(resourceName));
}

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

public static String getPropertyAsString(ZkClient zkClient, String clusterName,
  PropertyKey propertyKey, MediaType mediaType) throws JsonGenerationException,
  JsonMappingException, IOException {
 ZKHelixDataAccessor accessor =
   new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(zkClient));
 ZNRecord record = EMPTY_ZNRECORD;
 HelixProperty property = accessor.getProperty(propertyKey);
 if (property != null) {
  record = property.getRecord();
 }
 return ObjectToJson(record);
}

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

@Override
public void setResourceIdealState(String clusterName, String resourceName,
  IdealState idealState) {
 logger
   .info("Set IdealState for resource {} in cluster {} with new IdealState {}.", resourceName,
     clusterName, idealState == null ? "NULL" : idealState.toString());
 HelixDataAccessor accessor =
   new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
 Builder keyBuilder = accessor.keyBuilder();
 accessor.setProperty(keyBuilder.idealStates(resourceName), idealState);
}

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

@Override
public ClusterConstraints getConstraints(String clusterName,
  ConstraintType constraintType) {
 HelixDataAccessor accessor =
   new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
 Builder keyBuilder = new Builder(clusterName);
 return accessor.getProperty(keyBuilder.constraint(constraintType.toString()));
}

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

@Override
public void dropResource(String clusterName, String resourceName) {
 logger.info("Drop resource {} from cluster {}", resourceName, clusterName);
 HelixDataAccessor accessor =
   new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
 Builder keyBuilder = accessor.keyBuilder();
 accessor.removeProperty(keyBuilder.idealStates(resourceName));
 accessor.removeProperty(keyBuilder.resourceConfig(resourceName));
}

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

public static String getInstanceSessionId(ZkClient zkClient, String clusterName,
  String instanceName) {
 ZKHelixDataAccessor accessor =
   new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(zkClient));
 Builder keyBuilder = accessor.keyBuilder();
 ZNRecord liveInstance = accessor.getProperty(keyBuilder.liveInstance(instanceName)).getRecord();
 return liveInstance.getSimpleField(LiveInstanceProperty.SESSION_ID.toString());
}

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

protected void setupLiveInstances(String clusterName, int[] liveInstances) {
 ZKHelixDataAccessor accessor =
   new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_gZkClient));
 Builder keyBuilder = accessor.keyBuilder();
 for (int i = 0; i < liveInstances.length; i++) {
  String instance = "localhost_" + liveInstances[i];
  LiveInstance liveInstance = new LiveInstance(instance);
  liveInstance.setSessionId("session_" + liveInstances[i]);
  liveInstance.setHelixVersion("0.0.0");
  accessor.setProperty(keyBuilder.liveInstance(instance), liveInstance);
 }
}

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