gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-14 11:04:49 27 4
gpt4 key购买 nike

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

ZkClient.writeData介绍

暂无

代码示例

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

@Test
public void testCloseZkClientInZkClientEventThread() throws Exception {
 String className = TestHelper.getTestClassName();
 String methodName = TestHelper.getTestMethodName();
 String clusterName = className + "_" + methodName;
 System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
 final CountDownLatch waitCallback = new CountDownLatch(1);
 final ZkClient client =
   new ZkClient(ZK_ADDR, HelixZkClient.DEFAULT_SESSION_TIMEOUT,
     HelixZkClient.DEFAULT_CONNECTION_TIMEOUT, new ZNRecordSerializer());
 String path = String.format("/%s", clusterName);
 client.createEphemeral(path);
 client.subscribeDataChanges(path, new IZkDataListener() {
  @Override
  public void handleDataDeleted(String dataPath) throws Exception {
  }
  @Override
  public void handleDataChange(String dataPath, Object data) throws Exception {
   client.close();
   waitCallback.countDown();
  }
 });
 client.writeData(path, new ZNRecord("test"));
 waitCallback.await();
 Assert.assertFalse(_gZkClient.exists(path), "Ephemeral node: " + path
   + " should be removed after ZkClient#close() in its own event-thread");
 System.out.println("END " + clusterName + " at " + new Date(System.currentTimeMillis()));
}

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

zkClient.writeData(TEST_PATH, TEST_DATA);
Assert.assertEquals((long) beanServer.getAttribute(rootname, "WriteCounter"), 2);
Assert.assertEquals((long) beanServer.getAttribute(rootname, "WriteBytesCounter"),

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

_zkclient.writeData(liveInstancePath, curLiveInstance.getRecord());

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

zkClient.writeData(path, record, stat.getVersion());

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

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

_zkClient.writeData(path, new ZNRecord(clusterName));
path = PropertyPathBuilder.instanceConfig(clusterName);
_zkClient.createPersistent(path);

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