gpt4 book ai didi

org.apache.twill.zookeeper.ZKClientService.create()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 20:24:40 26 4
gpt4 key购买 nike

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

ZKClientService.create介绍

暂无

代码示例

代码示例来源:origin: co.cask.cdap/cdap-kafka

client.create(path, null, CreateMode.PERSISTENT),
KeeperException.NodeExistsException.class, path).get();

代码示例来源:origin: cdapio/cdap

client.create(path, null, CreateMode.PERSISTENT),
KeeperException.NodeExistsException.class, path).get();

代码示例来源:origin: cdapio/cdap

@Override
public void start() throws Exception {
 logAppenderInitializer.initialize();
 resetShutdownTime();
 createDirectory("twill");
 createSystemHBaseNamespace();
 updateConfigurationTable();
 Services.startAndWait(zkClient, cConf.getLong(Constants.Zookeeper.CLIENT_STARTUP_TIMEOUT_MILLIS),
            TimeUnit.MILLISECONDS,
            String.format("Connection timed out while trying to start ZooKeeper client. Please " +
                    "verify that the ZooKeeper quorum settings are correct in cdap-site.xml. " +
                    "Currently configured as: %s", cConf.get(Constants.Zookeeper.QUORUM)));
 // Tries to create the ZK root node (which can be namespaced through the zk connection string)
 Futures.getUnchecked(ZKOperations.ignoreError(zkClient.create("/", null, CreateMode.PERSISTENT),
                        KeeperException.NodeExistsException.class, null));
 electionInfoService.startAndWait();
 leaderElection.startAndWait();
}

代码示例来源:origin: org.apache.twill/twill-yarn

ZKOperations.ignoreError(zkClientService.create("/", null, CreateMode.PERSISTENT),
             KeeperException.NodeExistsException.class, null).get();

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

ZKOperations.ignoreError(zkClientService.create("/", null, CreateMode.PERSISTENT),
             KeeperException.NodeExistsException.class, null).get();

代码示例来源:origin: cdapio/cdap

@Before
public void beforeTest() throws Exception {
 zkServer = InMemoryZKServer.builder().setDataDir(TEMP_FOLDER.newFolder()).build();
 zkServer.startAndWait();
 CConfiguration cConf = CConfiguration.create();
 String kafkaZKNamespace = cConf.get(KafkaConstants.ConfigKeys.ZOOKEEPER_NAMESPACE_CONFIG);
 kafkaZKConnect = zkServer.getConnectionStr();
 if (kafkaZKNamespace != null) {
  ZKClientService zkClient = new DefaultZKClientService(zkServer.getConnectionStr(), 2000, null,
                             ImmutableMultimap.<String, byte[]>of());
  zkClient.startAndWait();
  zkClient.create("/" + kafkaZKNamespace, null, CreateMode.PERSISTENT);
  zkClient.stopAndWait();
  kafkaZKConnect += "/" + kafkaZKNamespace;
 }
 kafkaServer = createKafkaServer(kafkaZKConnect, TEMP_FOLDER.newFolder());
 kafkaServer.startAndWait();
}

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