gpt4 book ai didi

org.apache.drill.exec.ZookeeperTestUtil类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 09:58:33 26 4
gpt4 key购买 nike

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

ZookeeperTestUtil介绍

暂无

代码示例

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

@BeforeClass
public static void initCluster() throws Exception {
 ZookeeperTestUtil.setJaasTestConfigFile();

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

@BeforeClass
public static void initKafka() throws Exception {
 synchronized (TestKafkaSuit.class) {
  if (initCount.get() == 0) {
   ZookeeperTestUtil.setZookeeperSaslTestConfigProps();
   System.setProperty(JaasUtils.JAVA_LOGIN_CONFIG_PARAM, ClassLoader.getSystemResource(LOGIN_CONF_RESOURCE_PATHNAME).getFile());
   embeddedKafkaCluster = new EmbeddedKafkaCluster();
   Properties topicProps = new Properties();
   zkClient = new ZkClient(embeddedKafkaCluster.getZkServer().getConnectionString(), SESSION_TIMEOUT, CONN_TIMEOUT, ZKStringSerializer$.MODULE$);
   ZkUtils zkUtils = new ZkUtils(zkClient, new ZkConnection(embeddedKafkaCluster.getZkServer().getConnectionString()), false);
   AdminUtils.createTopic(zkUtils, TestQueryConstants.JSON_TOPIC, 1, 1, topicProps, RackAwareMode.Disabled$.MODULE$);
   org.apache.kafka.common.requests.MetadataResponse.TopicMetadata fetchTopicMetadataFromZk = AdminUtils
     .fetchTopicMetadataFromZk(TestQueryConstants.JSON_TOPIC, zkUtils);
   logger.info("Topic Metadata: " + fetchTopicMetadataFromZk);
   KafkaMessageGenerator generator = new KafkaMessageGenerator(embeddedKafkaCluster.getKafkaBrokerList(),
     StringSerializer.class);
   generator.populateJsonMsgIntoKafka(TestQueryConstants.JSON_TOPIC, NUM_JSON_MSG);
  }
  initCount.incrementAndGet();
  runningSuite = true;
 }
 logger.info("Initialized Embedded Zookeeper and Kafka");
}

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