clolov commented on code in PR #13537: URL: https://github.com/apache/kafka/pull/13537#discussion_r1165179192
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/consumer/Assignment.java: ########## @@ -0,0 +1,144 @@ +/* + * 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.consumer; + +import org.apache.kafka.common.Uuid; +import org.apache.kafka.coordinator.group.generated.ConsumerGroupTargetAssignmentMemberValue; + +import java.nio.ByteBuffer; +import java.util.Collections; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * A immutable assignment for a member. Review Comment: ```suggestion * An immutable assignment for a member. ``` ########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/consumer/ClientAssignor.java: ########## @@ -0,0 +1,150 @@ +/* + * 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.consumer; + +import org.apache.kafka.coordinator.group.generated.ConsumerGroupMemberMetadataValue; + +import java.nio.ByteBuffer; +import java.util.Objects; + +/** + * An immutable representation of an client side assignor within a consumer group member. Review Comment: ```suggestion * An immutable representation of a client side assignor within a consumer group member. ``` ########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/consumer/ClientAssignor.java: ########## @@ -0,0 +1,150 @@ +/* + * 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.consumer; + +import org.apache.kafka.coordinator.group.generated.ConsumerGroupMemberMetadataValue; + +import java.nio.ByteBuffer; +import java.util.Objects; + +/** + * An immutable representation of an client side assignor within a consumer group member. + */ +public class ClientAssignor { + /** + * The name of the assignor. + */ + private final String name; + + /** + * The reason reported by the assignor. + */ + private final byte reason; + + /** + * The minimum metadata version supported by the assignor. + */ + private final short minimumVersion; + + /** + * The maximum metadata version supported by the assignor. + */ + private final short maximumVersion; + + /** + * The versioned metadata. + */ + private final VersionedMetadata metadata; + + public ClientAssignor( + String name, + byte reason, + short minimumVersion, + short maximumVersion, + VersionedMetadata metadata + ) { + this.name = Objects.requireNonNull(name); Review Comment: All of Assignment, ClientAssignor, TopicMetadata and VersionedMetadata have requirements for some of the arguments to not be null. As far as I can see the tests which check that a exceptions are being thrown are those in TopicMetadataTest and VersionedMetadataTest. As a very small change I would request that we carry out such tests for the Assignment and the Client Assignor as well. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org