public interface AdminUtils
kafka.admin.AdminUtils#createTopic(ZkUtils, String, int, int, Properties, RackAwareMode),
,
kafka.admin.AdminUtils#deleteTopic(ZkUtils, String),
,
kafka.admin.AdminUtils#changeTopicConfig(ZkUtils, String, Properties), and
,
AdminUtils.topicExists(ZkUtils, String)
Modifier and Type | Method and Description |
---|---|
void |
changeTopicConfig(String topicName,
Map<String,String> topicConfig,
io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> completionHandler)
Updates the configuration of the topic given by topicName.
|
void |
close(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> completionHandler)
Closes the underlying connection to Zookeeper.
|
static AdminUtils |
create(io.vertx.core.Vertx vertx,
String zookeeperHosts)
Create a new AdminUtils instance
|
static AdminUtils |
create(io.vertx.core.Vertx vertx,
String zookeeperHosts,
boolean autoClose)
Create a new AdminUtils instance
|
static AdminUtils |
create(io.vertx.core.Vertx vertx,
String zookeeperHosts,
int connectionTimeoutMs,
boolean isSecure,
boolean autoClose)
Create a new AdminUtils instance
|
void |
createTopic(String topicName,
int partitionCount,
int replicationFactor,
io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> completionHandler)
Creates a new Kafka topic on all Brokers managed by the given Zookeeper instance(s)
|
void |
createTopic(String topicName,
int partitionCount,
int replicationFactor,
Map<String,String> topicConfig,
io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> completionHandler)
Creates a new Kafka topic on all Brokers managed by the given Zookeeper instance(s).
|
void |
deleteTopic(String topicName,
io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> completionHandler)
Delete the Kafka topic given by the topicName.
|
void |
topicExists(String topicName,
io.vertx.core.Handler<io.vertx.core.AsyncResult<Boolean>> completionHandler)
Checks if the Kafka topic given by topicName does exist.
|
static AdminUtils create(io.vertx.core.Vertx vertx, String zookeeperHosts)
vertx
- Vert.x instance to usezookeeperHosts
- comma-separated list of Zookeeper server, e.g. localhost:2181,localhost:2182static AdminUtils create(io.vertx.core.Vertx vertx, String zookeeperHosts, boolean autoClose)
vertx
- Vert.x instance to usezookeeperHosts
- comma-separated list of Zookeeper server, e.g. localhost:2181,localhost:2182autoClose
- If set to true, the client will auto-close the connection after a commandstatic AdminUtils create(io.vertx.core.Vertx vertx, String zookeeperHosts, int connectionTimeoutMs, boolean isSecure, boolean autoClose)
vertx
- Vert.x instance to usezookeeperHosts
- comma-separated list of Zookeeper server, e.g. localhost:2181,localhost:2182connectionTimeoutMs
- Maximum time in ms to wait for the client to connect to ZookeeperisSecure
- If set to true, ZkUtils will perform security checks, i.e. ACL checksautoClose
- If set to true, the client will auto-close the connection after a commandvoid createTopic(String topicName, int partitionCount, int replicationFactor, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> completionHandler)
topicName
- Name of the to-be-created topicpartitionCount
- Number of partitionsreplicationFactor
- Number of replicates. Must be lower or equal to the number of available BrokerscompletionHandler
- vert.x callbackvoid createTopic(String topicName, int partitionCount, int replicationFactor, Map<String,String> topicConfig, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> completionHandler)
createTopic(String, int, int, Handler)
, one can pass in additional configuration
parameters as a map (String -> String).topicName
- Name of the to-be-created topicpartitionCount
- Number of partitionsreplicationFactor
- Number of replicates. Must be lower or equal to the number of available BrokerstopicConfig
- map with additional topic configuration parameterscompletionHandler
- vert.x callbackvoid deleteTopic(String topicName, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> completionHandler)
topicName
- Name of the topic to be deletedcompletionHandler
- vert.x callbackvoid topicExists(String topicName, io.vertx.core.Handler<io.vertx.core.AsyncResult<Boolean>> completionHandler)
topicName
- Name of the topiccompletionHandler
- vert.x callbackvoid changeTopicConfig(String topicName, Map<String,String> topicConfig, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> completionHandler)
topicName
- topic to be configuredtopicConfig
- Map with configuration itemscompletionHandler
- vert.x callbackvoid close(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> completionHandler)
completionHandler
- vert.x callbackCopyright © 2019 Eclipse. All rights reserved.