Package org.apache.kafka.clients.admin
Class NewTopic
java.lang.Object
org.apache.kafka.clients.admin.NewTopic
A new topic to be created via
Admin.createTopics(Collection)
.-
Constructor Summary
ConstructorDescriptionA new topic with the specified replication factor and number of partitions.A new topic with the specified replica assignment configuration.A new topic that optionally defaultsnumPartitions
andreplicationFactor
to the broker configurations fornum.partitions
anddefault.replication.factor
respectively. -
Method Summary
Modifier and TypeMethodDescriptionconfigs()
The configuration for the new topic or null if no configs ever specified.Set the configuration to use on the new topic.boolean
int
hashCode()
name()
The name of the topic to be created.int
The number of partitions for the new topic or -1 if a replica assignment has been specified.A map from partition id to replica ids (i.e.short
The replication factor for the new topic or -1 if a replica assignment has been specified.toString()
-
Constructor Details
-
NewTopic
A new topic with the specified replication factor and number of partitions. -
NewTopic
A new topic that optionally defaultsnumPartitions
andreplicationFactor
to the broker configurations fornum.partitions
anddefault.replication.factor
respectively. -
NewTopic
A new topic with the specified replica assignment configuration.- Parameters:
name
- the topic name.replicasAssignments
- a map from partition id to replica ids (i.e. broker ids). Although not enforced, it is generally a good idea for all partitions to have the same number of replicas.
-
-
Method Details
-
name
The name of the topic to be created. -
numPartitions
public int numPartitions()The number of partitions for the new topic or -1 if a replica assignment has been specified. -
replicationFactor
public short replicationFactor()The replication factor for the new topic or -1 if a replica assignment has been specified. -
replicasAssignments
A map from partition id to replica ids (i.e. broker ids) or null if the number of partitions and replication factor have been specified instead. -
configs
Set the configuration to use on the new topic.- Parameters:
configs
- The configuration map.- Returns:
- This NewTopic object.
-
configs
The configuration for the new topic or null if no configs ever specified. -
toString
-
equals
-
hashCode
public int hashCode()
-