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 Group {
        /**
         * The members.
         */
        List<GroupMember> members;

        /**
         * The mapping from topic ID to number of partitions
         * as provided by the group coordinator
         */
        Map<Uuid, Integer> topicMetadata;
    }

    class GroupMember {
        /**
         * The member ID.
         */
        String memberId;

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

        /**
         * The set of topic IDs that the member is subscribed to.
         */
        List<Uuid> subscribedTopicIds;

        /**
         * The partitions owned by the member at the current epoch.
         */
        List<TopicIdPartition> ownedPartitions;
    }

    class Assignment {
        /**
         * The member assignment.
         */
        List<MemberAssignment> members;
    }

    class MemberAssignment {
        /**
         * The member ID.
         */
        String memberId;

        /**
         * The assigned partitions.
         */
        List<TopicIdPartition> partitions;
    }

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

    /**
     * Perform the group assignment given the current members and
     * topic metadata.
     *
     * @param group The group state.
     * @return The new assignment for the group.
     */
    Assignment assign(Group group);
}

Broker Metrics

The set of new metrics is not clear at the moment. We plan to amend the KIP later on when progress on the implementation would have been made.

  • Group count by type
  • Group count by state
  • Rebalance Rate

...

NameTypeDefaultDoc
group.protocolenumgeneric

A flag which indicates if the new protocol should be used or not. It could be: generic or consumer

group.remote.assignorstringuniformThe server side assignor to use. It cannot be used in conjunction with group.local.assignor.
group.local.assignorslistemptyThe list of client side (local) assignors. It cannot be used in conjunction with group.remote.assignor.

Streams Metadata

TODO

name

type

note

processId

uuid / static

Inherited. In the future we may also remove this field when one instance only use one consumer

userEndPoint

bytes / static

Inherited

clientTags

map / static

Inherited

errorCode

int8 / dynamic

Inherited and enhanced. Communicate rebalance reasons, possible values:

  • None
  • Shutdown
  • Warm-up ready
  • Warm-up failed
  • Requested by coordinator
  • Topology changed
  • [more?]

topologyHash

uuid / dynamic

Only updatable when errorCode is not “none”.

taskLag

array / dynamic

Only updatable when errorCode is not “none”.


name

type

note

activeTasks

list

Inherited

standbyTasks

map

Modified, only contain normal standby tasks

warmupTasks

map

New, warm-up standby tasks

partitionsByHost

map

Merged, global assignment information used for IQ

errorCode

int8

Inherited, possible values:

  • None
  • Shutdown
  • AssignmentError
  • InconsistentTopology
  • [more?]

Streams Configurations

NameTypeDefaultDoc
group.protocolenumgeneric

A flag which indicates if the new protocol should be used or not. It could be: generic or consumer

...