Class CreateTopicPolicy.RequestMetadata

java.lang.Object
org.apache.kafka.server.policy.CreateTopicPolicy.RequestMetadata
Enclosing interface:
CreateTopicPolicy

public static class CreateTopicPolicy.RequestMetadata extends Object
Class containing the create request parameters.
  • 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. This constructor is public to make testing of CreateTopicPolicy 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 the configure() method of the policy implementation.
  • Method Details

    • topic

      public String topic()
      Return the name of the topic to create.
    • numPartitions

      public Integer numPartitions()
      Return the number of partitions to create or null if replicaAssignments is not null.
    • replicationFactor

      public Short replicationFactor()
      Return the number of replicas to create or null if replicaAssignments is not null.
    • replicasAssignments

      public Map<Integer,List<Integer>> replicasAssignments()
      Return a map from partition id to replica (broker) ids or null if numPartitions and replicationFactor are set instead.
    • configs

      public Map<String,String> configs()
      Return topic configs in the request, not including broker defaults. Broker configs are passed via the configure() method of the policy implementation.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object