Package org.apache.kafka.server.policy
Class CreateTopicPolicy.RequestMetadata
- java.lang.Object
-
- org.apache.kafka.server.policy.CreateTopicPolicy.RequestMetadata
-
- Enclosing interface:
- CreateTopicPolicy
public static class CreateTopicPolicy.RequestMetadata extends java.lang.Object
Class containing the create request parameters.
-
-
Constructor Summary
Constructors Constructor Description RequestMetadata(java.lang.String topic, java.lang.Integer numPartitions, java.lang.Short replicationFactor, java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> replicasAssignments, java.util.Map<java.lang.String,java.lang.String> configs)
Create an instance of this class with the provided parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>
configs()
Return topic configs in the request, not including broker defaults.java.lang.Integer
numPartitions()
Return the number of partitions to create or null if replicaAssignments is not null.java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>>
replicasAssignments()
Return a map from partition id to replica (broker) ids or null if numPartitions and replicationFactor are set instead.java.lang.Short
replicationFactor()
Return the number of replicas to create or null if replicaAssignments is not null.java.lang.String
topic()
Return the name of the topic to create.java.lang.String
toString()
-
-
-
Constructor Detail
-
RequestMetadata
public RequestMetadata(java.lang.String topic, java.lang.Integer numPartitions, java.lang.Short replicationFactor, java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> replicasAssignments, java.util.Map<java.lang.String,java.lang.String> configs)
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 created.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.
-
-
Method Detail
-
topic
public java.lang.String topic()
Return the name of the topic to create.
-
numPartitions
public java.lang.Integer numPartitions()
Return the number of partitions to create or null if replicaAssignments is not null.
-
replicationFactor
public java.lang.Short replicationFactor()
Return the number of replicas to create or null if replicaAssignments is not null.
-
replicasAssignments
public java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> replicasAssignments()
Return a map from partition id to replica (broker) ids or null if numPartitions and replicationFactor are set instead.
-
configs
public java.util.Map<java.lang.String,java.lang.String> configs()
Return topic configs in the request, not including broker defaults. Broker configs are passed via theconfigure()
method of the policy implementation.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-