Package io.vertx.kafka.admin
Class NewTopic
java.lang.Object
io.vertx.kafka.admin.NewTopic
A new topic to be created
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()intshortSet the configuration for the new topic or null if no configs ever specifiedSet the name of the topic to be createdsetNumPartitions(int numPartitions) Set the number of partitions for the new topic or -1 if a replica assignment has been specifiedsetReplicasAssignments(Map<Integer, List<Integer>> replicasAssignments) Set a map from partition id to replica idssetReplicationFactor(short replicationFactor) Set the replication factor for the new topic or -1 if a replica assignment has been specifiedtoJson()Convert object to JSON representationtoString()
-
Constructor Details
-
NewTopic
public NewTopic()Constructor -
NewTopic
Constructor- Parameters:
name- the topic namenumPartitions- number of partitionsreplicationFactor- replication factor
-
NewTopic
Constructor- Parameters:
name- the topic namereplicasAssignments- a map from partition id to replica ids
-
NewTopic
Constructor (from JSON representation)- Parameters:
json- JSON representation
-
-
Method Details
-
getName
- Returns:
- the name of the topic to be created
-
setName
Set the name of the topic to be created- Parameters:
name- the name of the topic to be created- Returns:
- current instance of the class to be fluent
-
getNumPartitions
public int getNumPartitions()- Returns:
- the number of partitions for the new topic or -1 if a replica assignment has been specified
-
setNumPartitions
Set the number of partitions for the new topic or -1 if a replica assignment has been specified- Parameters:
numPartitions- the number of partitions for the new topic or -1 if a replica assignment has been specified- Returns:
- current instance of the class to be fluent
-
getReplicationFactor
public short getReplicationFactor()- Returns:
- the replication factor for the new topic or -1 if a replica assignment has been specified
-
setReplicationFactor
Set the replication factor for the new topic or -1 if a replica assignment has been specified- Parameters:
replicationFactor- the replication factor for the new topic or -1 if a replica assignment has been specified- Returns:
- current instance of the class to be fluent
-
getReplicasAssignments
- Returns:
- a map from partition id to replica ids
-
setReplicasAssignments
Set a map from partition id to replica ids- Parameters:
replicasAssignments- a map from partition id to replica ids- Returns:
- current instance of the class to be fluent
-
getConfig
- Returns:
- the configuration for the new topic or null if no configs ever specified
-
setConfig
Set the configuration for the new topic or null if no configs ever specified- Parameters:
config- the configuration for the new topic or null if no configs ever specified- Returns:
- current instance of the class to be fluent
-
toJson
Convert object to JSON representation- Returns:
- JSON representation
-
toString
-