Jackie-Jiang commented on code in PR #17811:
URL: https://github.com/apache/pinot/pull/17811#discussion_r2887234126


##########
pinot-spi/src/main/java/org/apache/pinot/spi/stream/StreamMetadata.java:
##########
@@ -0,0 +1,73 @@
+/**
+ * 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.pinot.spi.stream;
+
+import java.util.Collections;
+import java.util.List;
+
+
+/**
+ * Groups partition metadata for a single stream/topic.
+ *
+ * <p>This replaces the flat {@code List<PartitionGroupMetadata>} pattern 
where partitions from all streams were mixed
+ * together and required partition ID padding to identify stream membership.
+ *
+ * <p>The {@link PartitionGroupMetadata} items within this container use 
Pinot-encoded partition IDs
+ * (i.e., {@code streamIndex * 10000 + streamPartitionId}) to maintain 
backward compatibility with segment names
+ * stored in ZooKeeper.
+ */
+public class StreamMetadata {
+
+  private final StreamConfig _streamConfig;
+  private final int _streamConfigIndex;

Review Comment:
   They seem not used



##########
pinot-spi/src/main/java/org/apache/pinot/spi/stream/PartitionGroupMetadata.java:
##########
@@ -22,18 +22,27 @@
  * A PartitionGroup is a group of partitions/shards that the same consumer 
should consume from.
  * This class is a container for the metadata regarding a partition group, 
that is needed by a consumer to start
  * consumption.
- * It consists of
+ * It consists of:
  * 1. A unique partition group id for this partition group
  * 2. The start offset to begin consumption for this partition group
+ * 3. The sequence number for the consuming segment (used when creating 
segments with designated offsets/sequences)
  */
 public class PartitionGroupMetadata {
 
+  private static final int DEFAULT_SEQUENCE_NUMBER = 0;

Review Comment:
   Should we consider putting `-1` as default? When creating a new partition, 
explicitly set it to 0 or desired sequence number



##########
pinot-spi/src/main/java/org/apache/pinot/spi/stream/StreamMetadata.java:
##########
@@ -0,0 +1,73 @@
+/**
+ * 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.pinot.spi.stream;
+
+import java.util.Collections;
+import java.util.List;
+
+
+/**
+ * Groups partition metadata for a single stream/topic.
+ *
+ * <p>This replaces the flat {@code List<PartitionGroupMetadata>} pattern 
where partitions from all streams were mixed
+ * together and required partition ID padding to identify stream membership.
+ *
+ * <p>The {@link PartitionGroupMetadata} items within this container use 
Pinot-encoded partition IDs
+ * (i.e., {@code streamIndex * 10000 + streamPartitionId}) to maintain 
backward compatibility with segment names
+ * stored in ZooKeeper.
+ */
+public class StreamMetadata {
+
+  private final StreamConfig _streamConfig;
+  private final int _streamConfigIndex;
+  private final int _partitionCount;

Review Comment:
   (minor) We usually use `_numPartitions`



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to