You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/12/01 23:16:05 UTC

[GitHub] [kafka] andymg3 commented on a diff in pull request #12892: KAFKA-14386: Return TopicAssignment from the ReplicaPlacer

andymg3 commented on code in PR #12892:
URL: https://github.com/apache/kafka/pull/12892#discussion_r1037646184


##########
metadata/src/main/java/org/apache/kafka/metadata/placement/TopicAssignment.java:
##########
@@ -0,0 +1,39 @@
+/*
+ * 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.metadata.placement;
+
+import java.util.List;
+
+/**
+ * The KRaft topic assignment.
+ */
+public class TopicAssignment {
+    private List<PartitionAssignment> assignments;
+
+    public TopicAssignment(List<PartitionAssignment> assignments) {
+        this.assignments = assignments;

Review Comment:
   Updated to:
   ```
       public TopicAssignment(final List<PartitionAssignment> assignments) {
           this.assignments = Collections.unmodifiableList(assignments);
       }
   ```
   Also commented on both this class and `PartitionAssignment` that they're immutable.



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org