congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
AdminZkClient.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
kafka.zk.AdminZkClient
constructor

Best Java code snippets using kafka.zk.AdminZkClient.<init> (Showing top 6 results out of 315)

origin: apache/hive

/**
 * Override to set up your specific external resource.
 *
 * @throws Throwable if setup fails (which will disable {@code after}
 */
@Override protected void before() throws Throwable {
 // Start the ZK and the Broker
 LOG.info("init embedded Zookeeper");
 zkServer = new EmbeddedZookeeper();
 tmpLogDir = Files.createTempDirectory("kafka-log-dir-").toAbsolutePath();
 String zkConnect = "127.0.0.1:" + zkServer.port();
 LOG.info("init kafka broker");
 Properties brokerProps = new Properties();
 brokerProps.setProperty("zookeeper.connect", zkConnect);
 brokerProps.setProperty("broker.id", "0");
 brokerProps.setProperty("log.dir", tmpLogDir.toString());
 brokerProps.setProperty("listeners", "PLAINTEXT://" + BROKER_IP_PORT);
 brokerProps.setProperty("offsets.topic.replication.factor", "1");
 brokerProps.setProperty("transaction.state.log.replication.factor", "1");
 brokerProps.setProperty("transaction.state.log.min.isr", "1");
 KafkaConfig config = new KafkaConfig(brokerProps);
 kafkaServer = TestUtils.createServer(config, Time.SYSTEM);
 kafkaServer.startup();
 kafkaServer.zkClient();
 adminZkClient = new AdminZkClient(kafkaServer.zkClient());
 LOG.info("Creating kafka TOPIC [{}]", TOPIC);
 adminZkClient.createTopic(TOPIC, 1, 1, new Properties(), RackAwareMode.Disabled$.MODULE$);
}
origin: linkedin/kafka-monitor

void maybeAddPartitions(int minPartitionNum) {
 KafkaZkClient zkClient = KafkaZkClient.apply(_zkConnect, JaasUtils.isZkSecurityEnabled(), ZK_SESSION_TIMEOUT_MS,
   ZK_CONNECTION_TIMEOUT_MS, Integer.MAX_VALUE, Time.SYSTEM, METRIC_GROUP_NAME, "SessionExpireListener");
 AdminZkClient adminZkClient = new AdminZkClient(zkClient);
 try {
  scala.collection.Map<Object, scala.collection.Seq<Object>> existingAssignment = getPartitionAssignment(zkClient, _topic);
  int partitionNum = existingAssignment.size();
  if (partitionNum < minPartitionNum) {
   LOG.info("MultiClusterTopicManagementService will increase partition of the topic {} "
     + "in cluster {} from {} to {}.", _topic, _zkConnect, partitionNum, minPartitionNum);
   scala.Option<scala.collection.Map<java.lang.Object, scala.collection.Seq<java.lang.Object>>> replicaAssignment = scala.Option.apply(null);
   scala.Option<Seq<Object>> brokerList = scala.Option.apply(null);
   adminZkClient.addPartitions(_topic, existingAssignment, adminZkClient.getBrokerMetadatas(RackAwareMode.Disabled$.MODULE$, brokerList), minPartitionNum, replicaAssignment, false);
  }
 } finally {
  zkClient.close();
 }
}
origin: debezium/debezium

  server.startup();
  LOGGER.info("Started Kafka server {} at {} with storage in {}", brokerId, getConnection(), logsDir.getAbsolutePath());
  adminZkClient = new AdminZkClient(server.zkClient());
  return this;
} catch (RuntimeException e) {
origin: allegro/hermes

private AdminZkClient adminZkClient(KafkaZkClient kafkaZkClient) {
  return new AdminZkClient(kafkaZkClient);
}
origin: allegro/hermes

private void createTopic(String topicName, KafkaZkClient kafkaZkClient) {
  Topic topic = topic(topicName).build();
  kafkaNamesMapper.toKafkaTopics(topic).forEach(kafkaTopic -> {
    AdminZkClient adminZkClient = new AdminZkClient(kafkaZkClient);
    adminZkClient.createTopic(kafkaTopic.name().asString(), DEFAULT_PARTITIONS, DEFAULT_REPLICATION_FACTOR, new Properties(), RackAwareMode.Enforced$.MODULE$);
    waitAtMost(adjust(Duration.ONE_MINUTE)).until(() -> {
          kafkaZkClient.topicExists(kafkaTopic.name().asString());
        }
    );
  });
}
origin: pl.allegro.tech.hermes/hermes-test-helper

private void createTopic(String topicName, KafkaZkClient kafkaZkClient) {
  Topic topic = topic(topicName).build();
  kafkaNamesMapper.toKafkaTopics(topic).forEach(kafkaTopic -> {
    AdminZkClient adminZkClient = new AdminZkClient(kafkaZkClient);
    adminZkClient.createTopic(kafkaTopic.name().asString(), DEFAULT_PARTITIONS, DEFAULT_REPLICATION_FACTOR, new Properties(), RackAwareMode.Enforced$.MODULE$);
    waitAtMost(adjust(Duration.ONE_MINUTE)).until(() -> {
          kafkaZkClient.topicExists(kafkaTopic.name().asString());
        }
    );
  });
}
kafka.zkAdminZkClient<init>

Popular methods of AdminZkClient

  • createTopic
  • deleteTopic
  • addPartitions
  • changeTopicConfig
  • getBrokerMetadatas

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setRequestProperty (URLConnection)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now