gpt4 book ai didi

com.dremio.service.coordinator.zk.ZKClusterCoordinator类的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 07:12:31 28 4
gpt4 key购买 nike

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

ZKClusterCoordinator介绍

[英]Manages cluster coordination utilizing zookeeper.
[中]利用zookeeper管理集群协调。

代码示例

代码示例来源:origin: dremio/dremio-oss

public int submitQuery(String planLocation, String queryString, String type, String zkQuorum, boolean local, int bits, String format, int width) throws Exception {
 SabotConfig config = SabotConfig.create();
 Preconditions.checkArgument(!local, "Can only run remote.");
 DremioClient client = null;
 Preconditions.checkArgument(!(planLocation == null && queryString == null), "Must provide either query file or query string");
 Preconditions.checkArgument(!(planLocation != null && queryString != null), "Must provide either query file or query string, not both");
 try {
  ZKClusterCoordinator clusterCoordinator = new ZKClusterCoordinator(config, zkQuorum);
  clusterCoordinator.start();
  client = new DremioClient(config, clusterCoordinator);
  client.connect();
  String plan;
  if (queryString == null) {
   plan = Charsets.UTF_8.decode(ByteBuffer.wrap(Files.readAllBytes(Paths.get(planLocation)))).toString();
  } else {
   plan = queryString;
  }
  return submitQuery(client, plan, type, format, width);
 } catch(Throwable th) {
  System.err.println("Query Failed due to : " + th.getMessage());
  return -1;
 } finally {
  if (client != null) {
   client.close();
  }
 }
}

代码示例来源:origin: dremio/dremio-oss

/**
 * Kill the given ZK session
 *
 * @param clusterCoordinator the cluster coordinator owning the session
 */
public static void kill(ZKClusterCoordinator clusterCoordinator) throws Exception {
 KillSession.kill(clusterCoordinator.getZkClient().getZooKeeperClient(), clusterCoordinator.getZkClient().getConnectionString());
}

代码示例来源:origin: dremio/dremio-oss

if (clusterCoordinator == null) {
 try {
  clusterCoordinator = new ZKClusterCoordinator(this.config, connect);
  clusterCoordinator.start();
 } catch (Exception e) {

代码示例来源:origin: dremio/dremio-oss

coord = new ZKClusterCoordinator(config.getSabotConfig(), portProvider);
} catch (IOException e) {
 throw new RuntimeException("Cannot instantiate the ZooKeeper cluster coordinator", e);

代码示例来源:origin: dremio/dremio-oss

@Test
public void testGivingUpLeadership() throws Exception {
 try(ZKClusterCoordinator coordinator = new ZKClusterCoordinator(
  DEFAULT_SABOT_CONFIG,
  String.format("%s/dremio/test/test-cluster-id", zooKeeperServer.getConnectString()))
 ) {
  coordinator.start();

代码示例来源:origin: dremio/dremio-oss

@Test
public void testElectionsWithRegistration() throws Exception {
 try(ZKClusterCoordinator coordinator = new ZKClusterCoordinator(
  DEFAULT_SABOT_CONFIG,
  String.format("%s/dremio/test/test-cluster-id", zooKeeperServer.getConnectString()))
 ) {
  coordinator.start();

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