Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleReplicaAssignor
package org.apache.kafka.server;

public interface ReplicaAssignor {

    /**
     * Assigns the specified partitions to brokers.
     * If an assignment can't be computed, for example if the state of the cluster does not statify a requirement,
     * implementations can throw a ReplicaAssignorException to prevent the topic/partition creation.
     * @param topicName The name of the topic
     * @param partitionspartitionIds The list of partitionIds that need an assignment
     * @param replicationFactor The replication factor of the topic
     * @param configs The topic configurations
     * @param cluster The cluster metadata
     * @param principal The principal of the user initiating the request
     * @return A map of partitionId to list of assigned brokers
     */
    public Map<Integer, List<Integer>> assignReplicasToBrokers(
            String topicName,
            List<Integer> partitionspartitionIds,
            int replicationFactor,
            Map<String, String> configs,
            Cluster cluster,
            KafkaPrincipal principal) throws ReplicaAssignorException;

}

...