apourchet commented on code in PR #15887: URL: https://github.com/apache/kafka/pull/15887#discussion_r1595700958
########## streams/src/main/java/org/apache/kafka/streams/processor/assignment/KafkaStreamsState.java: ########## @@ -0,0 +1,97 @@ +/* + * 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.streams.processor.assignment; + +import java.util.Map; +import java.util.Optional; +import java.util.SortedSet; +import org.apache.kafka.streams.processor.TaskId; +import org.apache.kafka.streams.state.HostInfo; + +/** + * A read-only metadata class representing the current state of each KafkaStreams client with at least one StreamThread participating in this rebalance + */ +public interface KafkaStreamsState { + /** + * @return the processId of the application instance running on this KafkaStreams client + */ + ProcessID processId(); + + /** + * Returns the number of processing threads available to work on tasks for this KafkaStreams client, + * which represents its overall capacity for work relative to other KafkaStreams clients. + * + * @return the number of processing threads on this KafkaStreams client + */ + int numProcessingThreads(); + + /** + * @return the set of consumer client ids for this KafkaStreams client + */ + SortedSet<String> consumerClientIds(); + + /** + * @return the set of all active tasks owned by consumers on this KafkaStreams client since the previous rebalance + */ + SortedSet<TaskId> previousActiveTasks(); + + /** + * @return the set of all standby tasks owned by consumers on this KafkaStreams client since the previous rebalance + */ + SortedSet<TaskId> previousStandbyTasks(); + + /** + * Returns the total lag across all logged stores in the task. Equal to the end offset sum if this client + * did not have any state for this task on disk. + * + * @return end offset sum - offset sum + * Task.LATEST_OFFSET if this was previously an active running task on this client Review Comment: IllegalArgumentException usually refers to an argument that was passed in, as opposed to some global misconfiguration, so I'll go for UnsupportedOperationException unless someone else feels strongly about it. -- 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]
