Package org.apache.kafka.server.policy
Class CreateTopicPolicy.RequestMetadata
java.lang.Object
org.apache.kafka.server.policy.CreateTopicPolicy.RequestMetadata
- Enclosing interface:
CreateTopicPolicy
Class containing the create request parameters.
-
Constructor Summary
ConstructorsConstructorDescriptionRequestMetadata
(String topic, Integer numPartitions, Short replicationFactor, Map<Integer, List<Integer>> replicasAssignments, Map<String, String> configs) Create an instance of this class with the provided parameters andTopicType.STANDARD
.RequestMetadata
(String topic, Integer numPartitions, Short replicationFactor, Map<Integer, List<Integer>> replicasAssignments, Map<String, String> configs, TopicType topicType) Create an instance of this class with the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionconfigs()
Return topic configs in the request, not including broker defaults.boolean
int
hashCode()
Return the number of partitions to create or null if replicaAssignments is not null.Return a map from partition id to replica (broker) ids or null if numPartitions and replicationFactor are set instead.Return the number of replicas to create or null if replicaAssignments is not null.topic()
Return the name of the topic to create.Return the type of the topic, e.g.toString()
-
Constructor Details
-
RequestMetadata
public RequestMetadata(String topic, Integer numPartitions, Short replicationFactor, Map<Integer, List<Integer>> replicasAssignments, Map<String, String> configs) Create an instance of this class with the provided parameters andTopicType.STANDARD
. This constructor is public to make testing ofCreateTopicPolicy
implementations easier.- Parameters:
topic
- the name of the topic to create.numPartitions
- the number of partitions to create or null if replicasAssignments is set.replicationFactor
- the replication factor for the topic or null if replicaAssignments is set.replicasAssignments
- replica assignments or null if numPartitions and replicationFactor is set. The assignment is a map from partition id to replica (broker) ids.configs
- topic configs for the topic to be created, not including broker defaults. Broker configs are passed via theconfigure()
method of the policy implementation.
-
RequestMetadata
public RequestMetadata(String topic, Integer numPartitions, Short replicationFactor, Map<Integer, List<Integer>> replicasAssignments, Map<String, String> configs, TopicType topicType) Create an instance of this class with the provided parameters. This constructor is public to make testing ofCreateTopicPolicy
implementations easier.- Parameters:
topic
- the name of the topic to create.numPartitions
- the number of partitions to create or null if replicasAssignments is set.replicationFactor
- the replication factor for the topic or null if replicaAssignments is set.replicasAssignments
- replica assignments or null if numPartitions and replicationFactor is set. The assignment is a map from partition id to replica (broker) ids.configs
- topic configs for the topic to be created, not including broker defaults. Broker configs are passed via theconfigure()
method of the policy implementation.topicType
- the type of the topic, e.g. STANDARD, FREIGHT, etc.
-
-
Method Details
-
topic
Return the name of the topic to create. -
numPartitions
Return the number of partitions to create or null if replicaAssignments is not null. -
replicationFactor
Return the number of replicas to create or null if replicaAssignments is not null. -
replicasAssignments
Return a map from partition id to replica (broker) ids or null if numPartitions and replicationFactor are set instead. -
configs
Return topic configs in the request, not including broker defaults. Broker configs are passed via theconfigure()
method of the policy implementation. -
topicType
Return the type of the topic, e.g. STANDARD, FREIGHT, etc. -
hashCode
public int hashCode() -
equals
-
toString
-