- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.helix.manager.zk.ZkClient.createPersistent()
方法的一些代码示例,展示了ZkClient.createPersistent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkClient.createPersistent()
方法的具体详情如下:
包路径:org.apache.helix.manager.zk.ZkClient
类名称:ZkClient
方法名:createPersistent
暂无
代码示例来源:origin: apache/incubator-pinot
FakeHelixManager(String clusterName, String instanceName, InstanceType instanceType, String zkAddress) {
super(clusterName, instanceName, instanceType, zkAddress);
super._zkclient = new ZkClient(StringUtil.join("/", StringUtils.chomp(ZkStarter.DEFAULT_ZK_STR, "/")),
ZkClient.DEFAULT_SESSION_TIMEOUT, ZkClient.DEFAULT_CONNECTION_TIMEOUT, new ZNRecordSerializer());
_zkclient.deleteRecursive("/" + clusterName + "/PROPERTYSTORE");
_zkclient.createPersistent("/" + clusterName + "/PROPERTYSTORE", true);
setPropertyStore(clusterName);
}
代码示例来源: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: org.apache.helix/helix-core
public static void createChildren(ZkClient client, String parentPath, ZNRecord nodeRecord) {
client.createPersistent(parentPath, true);
String id = nodeRecord.getId();
String temp = parentPath + "/" + id;
client.createPersistent(temp, nodeRecord);
}
代码示例来源:origin: org.apache.helix/helix-core
public static void createChildren(ZkClient client, String parentPath, List<ZNRecord> list) {
client.createPersistent(parentPath, true);
if (list != null) {
for (ZNRecord record : list) {
createChildren(client, parentPath, record);
}
}
}
代码示例来源:origin: org.apache.helix/helix-core
client.createPersistent(zkPath, true);
if (children != null && children.length > 0) {
client.createPersistent(zkPath, result);
} finally {
input.close();
代码示例来源:origin: org.apache.helix/helix-core
_zkClient.createPersistent(PropertyPathBuilder.idealState(clusterName));
_zkClient.createPersistent(path, true);
_zkClient.writeData(path, new ZNRecord(clusterName));
path = PropertyPathBuilder.instanceConfig(clusterName);
_zkClient.createPersistent(path);
path = PropertyPathBuilder.resourceConfig(clusterName);
_zkClient.createPersistent(path);
_zkClient.createPersistent(path);
_zkClient.createPersistent(PropertyPathBuilder.liveInstance(clusterName));
_zkClient.createPersistent(PropertyPathBuilder.instance(clusterName));
_zkClient.createPersistent(PropertyPathBuilder.externalView(clusterName));
_zkClient.createPersistent(PropertyPathBuilder.stateModelDef(clusterName));
_zkClient.createPersistent(PropertyPathBuilder.controller(clusterName));
path = PropertyPathBuilder.controllerHistory(clusterName);
final ZNRecord emptyHistory = new ZNRecord(PropertyType.HISTORY.toString());
final List<String> emptyList = new ArrayList<String>();
emptyHistory.setListField(clusterName, emptyList);
_zkClient.createPersistent(path, emptyHistory);
_zkClient.createPersistent(path);
_zkClient.createPersistent(path);
代码示例来源:origin: org.apache.helix/helix-core
_zkClient.createPersistent(root, true);
} catch (Exception e) {
代码示例来源:origin: org.apache.helix/helix-core
@Override
public void addInstance(String clusterName, InstanceConfig instanceConfig) {
logger.info("Add instance {} to cluster {}.", instanceConfig.getInstanceName(), clusterName);
if (!ZKUtil.isClusterSetup(clusterName, _zkClient)) {
throw new HelixException("cluster " + clusterName + " is not setup yet");
}
String instanceConfigsPath = PropertyPathBuilder.instanceConfig(clusterName);
String nodeId = instanceConfig.getId();
String instanceConfigPath = instanceConfigsPath + "/" + nodeId;
if (_zkClient.exists(instanceConfigPath)) {
throw new HelixException("Node " + nodeId + " already exists in cluster " + clusterName);
}
ZKUtil.createChildren(_zkClient, instanceConfigsPath, instanceConfig.getRecord());
_zkClient.createPersistent(PropertyPathBuilder.instanceMessage(clusterName, nodeId), true);
_zkClient.createPersistent(PropertyPathBuilder.instanceCurrentState(clusterName, nodeId), true);
_zkClient.createPersistent(PropertyPathBuilder.instanceError(clusterName, nodeId), true);
_zkClient.createPersistent(PropertyPathBuilder.instanceStatusUpdate(clusterName, nodeId), true);
_zkClient.createPersistent(PropertyPathBuilder.instanceHistory(clusterName, nodeId), true);
}
代码示例来源:origin: org.apache.helix/helix-core
public static boolean isInstanceSetup(ZkClient zkclient, String clusterName, String instanceName,
InstanceType type) {
if (type == InstanceType.PARTICIPANT || type == InstanceType.CONTROLLER_PARTICIPANT) {
ArrayList<String> requiredPaths = new ArrayList<>();
requiredPaths.add(PropertyPathBuilder.instanceConfig(clusterName, instanceName));
requiredPaths.add(PropertyPathBuilder.instanceMessage(clusterName, instanceName));
requiredPaths.add(PropertyPathBuilder.instanceCurrentState(clusterName, instanceName));
requiredPaths.add(PropertyPathBuilder.instanceStatusUpdate(clusterName, instanceName));
requiredPaths.add(PropertyPathBuilder.instanceError(clusterName, instanceName));
boolean isValid = true;
for (String path : requiredPaths) {
if (!zkclient.exists(path)) {
isValid = false;
logger.error("Invalid instance setup, missing znode path: {}", path);
}
}
if (isValid) {
// Create the instance history node if it does not exist.
// This is for back-compatibility.
String historyPath = PropertyPathBuilder.instanceHistory(clusterName, instanceName);
if (!zkclient.exists(historyPath)) {
zkclient.createPersistent(historyPath, true);
}
}
return isValid;
}
return true;
}
代码示例来源:origin: apache/helix
client.createPersistent(path, true);
代码示例来源:origin: apache/helix
_zkClient.createPersistent(TEST_ROOT, true);
代码示例来源:origin: apache/helix
ZkClient zkClient = ZKClientPool.getZkClient(zkAddr);
zkClient.createPersistent("/" + testName, new ZNRecord(testName));
ZNRecord record = zkClient.readData("/" + testName);
Assert.assertEquals(record.getId(), testName);
zkClient.createPersistent("/" + testName, new ZNRecord(testName));
record = zkClient.readData("/" + testName);
Assert.assertEquals(record.getId(), testName);
代码示例来源:origin: org.apache.helix/helix-core
} else {
try {
zkClient.createPersistent(path, true);
} catch (ZkNodeExistsException e) {
代码示例来源:origin: org.apache.helix/helix-core
public void post(String zkServer, Message message, String clusterName, String instanceName) {
ZkClient client = new ZkClient(zkServer);
client.setZkSerializer(new ZNRecordSerializer());
String path = PropertyPathBuilder.instanceMessage(clusterName, instanceName, message.getId());
client.delete(path);
ZNRecord record = client.readData(PropertyPathBuilder.liveInstance(clusterName, instanceName));
message.setTgtSessionId(record.getSimpleField(LiveInstanceProperty.SESSION_ID.toString()));
message.setTgtName(record.getId());
// System.out.println(message);
client.createPersistent(path, message.getRecord());
}
代码示例来源:origin: apache/helix
@Test()
void testGetStat() {
String path = "/tmp/getStatTest";
_zkClient.deleteRecursively(path);
Stat stat, newStat;
stat = _zkClient.getStat(path);
AssertJUnit.assertNull(stat);
_zkClient.createPersistent(path, true);
stat = _zkClient.getStat(path);
AssertJUnit.assertNotNull(stat);
newStat = _zkClient.getStat(path);
AssertJUnit.assertEquals(stat, newStat);
_zkClient.writeData(path, new ZNRecord("Test"));
newStat = _zkClient.getStat(path);
AssertJUnit.assertNotSame(stat, newStat);
}
本文整理了Java中org.I0Itec.zkclient.ZkClient.createPersistent()方法的一些代码示例,展示了ZkClient.createPersistent()的具体
本文整理了Java中org.apache.helix.manager.zk.ZkClient.createPersistent()方法的一些代码示例,展示了ZkClient.createPersist
本文整理了Java中com.ucar.datalink.common.zookeeper.ZkClientX.createPersistent()方法的一些代码示例,展示了ZkClientX.crea
本文整理了Java中com.alibaba.otter.canal.common.zookeeper.ZkClientx.createPersistent()方法的一些代码示例,展示了ZkClient
本文整理了Java中com.alibaba.dubbo.remoting.zookeeper.zkclient.ZkClientWrapper.createPersistent()方法的一些代码示例,
本文整理了Java中org.apache.dubbo.remoting.zookeeper.zkclient.ZkClientWrapper.createPersistent()方法的一些代码示例,展
本文整理了Java中com.alibaba.otter.shared.common.utils.zookeeper.ZkClientx.createPersistent()方法的一些代码示例,展示了Z
我是一名优秀的程序员,十分优秀!