Versions Compared

Key

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

...

Code Block
languagejava
linenumberstrue
package org.apache.kafka.server.group.consumer;

public interface PartitionAssignor {

    class AssignmentSpec {
        /**
         * The members keyed by member id.
         */
        Map<String, AssignmentMemberSpec> members;

        /**
         * The topics' metadata keyed by topic id
         */
        Map<Uuid, AssignmentTopicMetadata> topics;
    }

    class AssignmentMemberSpec {
        /**
         * The instance ID if provided.
         */
        Optional<String> instanceId;

        /**
         * The rack ID if provided.
         */
        Optional<String> rackId;

        /**
         * The topics that the member is subscribed to.
         */
        Collection<String> subscribedTopics;

        /**
         * The current target partitions of the member.
         */
        Collection<TopicPartition> targetPartitions;
    }

    class AssignmentTopicMetadata {
        /**
         * The topic name.
         */
        String topicName;

        /**
		 * The number of partitions.
		 */
		int numPartitions; 
    }

    class GroupAssignment {
        /**
         * The member assignments keyed by member id.
         */
        Map<String, MemberAssignment> members;
    }

    class MemberAssignment {
        /**
         * The target partitions assigned to this member.
         */
        Collection<TopicPartition> targetPartitions;
    }

    /**
     * Unique name for this assignor.
     */
    String name();

    /**
     * Perform the group assignment given the current members and
     * topic metadata.
     *
     * @param assignmentSpec The assignment spec.
     * @return The new assignment for the group.
     */
    GroupAssignment assign(AssignmentSpec assignmentSpec) throws PartitionAssignorException;
}

Broker Metrics

Group Coordinator Runtime Metrics

kafka.server:type=group-coordinator-metrics,name=num-partitions,state=loading

...

Existing generic group metrics have been migrated, with the same metric names except for

NumGroups which reported the number of generic groups. This metric changed to

kafka.server:type=group-coordinator-metrics,name=numgroups-partitionscount,state=activetype={consumer|generic}

  • number of __consumer_offsets partitions in Active stategroups based on type

kafka.server:type=group-coordinator-metrics,name=num-partitions,state={loading|active|failed}

  • number of __consumer_offsets partitions in Failed based on state

kafka.server:type=group-coordinator-metrics,name=event-queue-size

  • event accumulator queue size

...

kafka.server:type=group-coordinator-metrics,name=

...

thread idle ratio sensor: thread busy - idle ratio

  • kafka.server:type=group-coordinator-metrics,name=thread-idle-ratio-min
  • kafka.server:type=group-coordinator-metrics,name=thread-idle-ratio-avg

Group Coordinator Metrics

Existing generic group metrics have been migrated, with the same metric names.

kafka.server:type=group-coordinator-metrics,name=consumer-groups-count

  • number of consumer groups

kafka.server:type=group-coordinator-metrics,name=consumer-groups-count,state={empty|assigning|reconciling|stable|dead}

  • number of consumer groups in Empty based on state

generic group preparing rebalance sensor

  • kafka.server:type=group-coordinator-metrics,name=

...

  • generic-group-

...

  • number of consumer groups in Assigning staterebalance-rate
  • kafka.server:type=group-coordinator-metrics,name=

...

  • generic-group-

...

  • rebalance-count

...

  • number of consumer groups in Reconciling state

consumer group rebalances sensor

  • kafka.server:type=group-coordinator-metrics,name=consumer-

...

  • number of consumer groups in Stable stategroup-rebalance-rate
  • kafka.server:type=group-coordinator-metrics,name=consumer-

...

  • group-rebalance-count

...

partition load sensor: __consumer_offsets partition load time

...

  • number of consumer groups in Dead state

generic group preparing rebalance sensor

  • kafka.server:type=group-coordinator-metrics,name=genericpartition-groupload-rebalancetime-ratemax
  • kafka.server:type=group-coordinator-metrics,name=genericpartition-groupload-rebalancetime-countavg

thread idle ratio sensor: thread busy - idle ratioconsumer group rebalances sensor

  • kafka.server:type=group-coordinator-metrics,name=consumerthread-groupidle-rebalanceratio-ratemin
  • kafka.server:type=group-coordinator-metrics,name=consumerthread-groupidle-rebalanceratio-countavg

Broker Configurations

New properties in the broker configuration.

...