public final class TopicBuilder
extends java.lang.Object
NewTopic.| Modifier and Type | Method and Description |
|---|---|
org.apache.kafka.clients.admin.NewTopic |
build() |
TopicBuilder |
compact()
Set the
TopicConfig.CLEANUP_POLICY_CONFIG to
TopicConfig.CLEANUP_POLICY_COMPACT. |
TopicBuilder |
config(java.lang.String configName,
java.lang.String configValue)
Set a configuration option.
|
TopicBuilder |
configs(java.util.Map<java.lang.String,java.lang.String> configs)
Set the configs.
|
static TopicBuilder |
name(java.lang.String name)
Create a TopicBuilder with the supplied name.
|
TopicBuilder |
partitions(int partitions)
Set the number of partitions (default 1).
|
TopicBuilder |
replicas(int replicas)
Set the number of replicas (default 1).
|
TopicBuilder |
replicasAssignments(java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> replicasAssignments)
Set the replica assignments.
|
public TopicBuilder partitions(int partitions)
partitions - the partitions.public TopicBuilder replicas(int replicas)
replicas - the replicas (which will be cast to short).public TopicBuilder replicasAssignments(java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> replicasAssignments)
replicasAssignments - the assignments.NewTopic.replicasAssignments()public TopicBuilder configs(java.util.Map<java.lang.String,java.lang.String> configs)
configs - the configs.NewTopic.configs()public TopicBuilder config(java.lang.String configName, java.lang.String configValue)
configName - the name.configValue - the value.TopicConfigpublic TopicBuilder compact()
TopicConfig.CLEANUP_POLICY_CONFIG to
TopicConfig.CLEANUP_POLICY_COMPACT.public org.apache.kafka.clients.admin.NewTopic build()
public static TopicBuilder name(java.lang.String name)
name - the name.