public class NewTopic extends Object
Constructor and Description |
---|
NewTopic()
Constructor
|
NewTopic(JsonObject json)
Constructor (from JSON representation)
|
NewTopic(String name,
int numPartitions,
short replicationFactor)
Constructor
|
NewTopic(String name,
Map<Integer,List<Integer>> replicasAssignments)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
getConfig() |
String |
getName() |
int |
getNumPartitions() |
Map<Integer,List<Integer>> |
getReplicasAssignments() |
short |
getReplicationFactor() |
NewTopic |
setConfig(Map<String,String> config)
Set the configuration for the new topic or null if no configs ever specified
|
NewTopic |
setName(String name)
Set the name of the topic to be created
|
NewTopic |
setNumPartitions(int numPartitions)
Set the number of partitions for the new topic or -1 if a replica assignment has been specified
|
NewTopic |
setReplicasAssignments(Map<Integer,List<Integer>> replicasAssignments)
Set a map from partition id to replica ids
|
NewTopic |
setReplicationFactor(short replicationFactor)
Set the replication factor for the new topic or -1 if a replica assignment has been specified
|
JsonObject |
toJson()
Convert object to JSON representation
|
String |
toString() |
public NewTopic()
public NewTopic(String name, int numPartitions, short replicationFactor)
name
- the topic namenumPartitions
- number of partitionsreplicationFactor
- replication factorpublic NewTopic(String name, Map<Integer,List<Integer>> replicasAssignments)
name
- the topic namereplicasAssignments
- a map from partition id to replica idspublic NewTopic(JsonObject json)
json
- JSON representationpublic String getName()
public NewTopic setName(String name)
name
- the name of the topic to be createdpublic int getNumPartitions()
public NewTopic setNumPartitions(int numPartitions)
numPartitions
- the number of partitions for the new topic or -1 if a replica assignment has been specifiedpublic short getReplicationFactor()
public NewTopic setReplicationFactor(short replicationFactor)
replicationFactor
- the replication factor for the new topic or -1 if a replica assignment has been specifiedpublic Map<Integer,List<Integer>> getReplicasAssignments()
public NewTopic setReplicasAssignments(Map<Integer,List<Integer>> replicasAssignments)
replicasAssignments
- a map from partition id to replica idspublic Map<String,String> getConfig()
public NewTopic setConfig(Map<String,String> config)
config
- the configuration for the new topic or null if no configs ever specifiedpublic JsonObject toJson()
Copyright © 2024 Eclipse. All rights reserved.