gabriellefu commented on code in PR #22788: URL: https://github.com/apache/kafka/pull/22788#discussion_r3598807607
########## group-coordinator/group-coordinator-api/src/main/java/org/apache/kafka/coordinator/group/api/assignor/streams/MemberAssignmentState.java: ########## @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.kafka.coordinator.group.api.assignor.streams; + +import org.apache.kafka.common.annotation.InterfaceAudience; +import org.apache.kafka.common.annotation.InterfaceStability; + +import java.util.Map; +import java.util.Set; + +/** + * Interface representing the current assignment state for a streams group member. + * + * <p>This is the assignment the member currently owns and is used by the {@link TaskAssignor} + * to compute a new, sticky target assignment. Note that the assignor does not assign warm-up + * tasks itself (they are decided during reconciliation), but the currently-assigned warm-up + * tasks are exposed here so that the assignor can take them into account. + */ [email protected] [email protected] +public interface MemberAssignmentState { + + /** + * @return The current active tasks keyed by subtopology Id. + */ + Map<String, Set<Integer>> activeTasks(); + + /** + * @return The current standby tasks keyed by subtopology Id. + */ + Map<String, Set<Integer>> standbyTasks(); + + /** + * @return The current warm-up tasks keyed by subtopology Id. + */ + Map<String, Set<Integer>> warmupTasks(); + + /** + * @return The last received cumulative task offsets of assigned tasks or dormant tasks. + */ + Map<TaskId, Long> taskOffsets(); Review Comment: I think maybe keep it the Map<TaskId, Long> is more reasonable, I have update the interface of Taskid -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
