use of org.apache.kafka.streams.processor.internals.assignment.StreamsAssignmentProtocolVersions.LATEST_SUPPORTED_VERSION in project kafka by apache.
the class StreamsPartitionAssignor method subscriptionUserData.
@Override
public ByteBuffer subscriptionUserData(final Set<String> topics) {
// Adds the following information to subscription
// 1. Client UUID (a unique id assigned to an instance of KafkaStreams)
// 2. Map from task id to its overall lag
// 3. Unique Field to ensure a rebalance when a thread rejoins by forcing the user data to be different
handleRebalanceStart(topics);
uniqueField++;
final Set<String> currentNamedTopologies = taskManager.topologyMetadata().namedTopologiesView();
// If using NamedTopologies, filter out any that are no longer recognized/have been removed
final Map<TaskId, Long> taskOffsetSums = taskManager.topologyMetadata().hasNamedTopologies() ? filterMap(taskManager.getTaskOffsetSums(), t -> currentNamedTopologies.contains(t.getKey().topologyName())) : taskManager.getTaskOffsetSums();
return new SubscriptionInfo(usedSubscriptionMetadataVersion, LATEST_SUPPORTED_VERSION, taskManager.processId(), userEndPoint, taskOffsetSums, uniqueField, assignmentErrorCode.get()).encode();
}
Aggregations