THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||
---|---|---|---|---|
| ||||
package org.apache.kafka.server; @InterfaceStability.Evolving public interface ReplicaAssignor extends Configurable, Closeable { /** * Computes replica assignments for the specified partitions * * If an assignment can't be computed, for example if the state of the cluster does not satisfy a requirement, * implementations can throw ReplicaAssignorException to prevent the topic/partition creation. * @param partitions The partitions being created * @param cluster The cluster metadata * @param principal The principal of the user initiating the request * @return The computed replica assignments * @throw ReplicaAssignorException */ public ReplicaAssignment computeAssignment( NewPartitions partitions, Cluster cluster, KafkaPrincipal principal) throws ReplicaAssignorException; /** * Computed replica assignments for the specified partitions */ public class ReplicaAssignment { private final Map<Integer, List<Integer>> assignment; public ReplicaAssignment(Map<Integer, List<Integer>> assignment) { this.assignment = assignment; } /** * @return a Map with the list of replicas for each partition */ Map<Integer, List<Integer>> assignment() { return assignment; } } /** * Partitions which require an assignment to be computed */ public interface NewPartitions { /** * The name of the topic for these partitions */ String topicName(); /** * The list of partition ids */ List<Integer> partitionIds(); /** * The replication factor of the topic */ short replicationFactor(); /** * The configuration of the topic */ Map<String, String> configs(); } } |
...