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


##########
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/ForwardIndexConfig.java:
##########
@@ -79,6 +79,15 @@ public static ForwardIndexConfig getDisabled() {
     return new Builder(EncodingType.DICTIONARY).withDisabled(true).build();
   }
 
+  /// Writer version used for codec-pipeline forward indexes. Legacy 
fixed-byte writers
+  /// accept arbitrary versions greater than or equal to 4, so version 7 alone 
does not identify
+  /// this format; readers also require the explicit codec-pipeline header 
magic.
+  ///
+  /// **The version and structural header marker together are the frozen 
on-disk identifier.**
+  /// Version 7 must never be used alone to dispatch this format because 
legacy fixed-byte writers
+  /// can also emit that value. A new format must define an unambiguous 
discriminator.
+  public static final int CODEC_PIPELINE_WRITER_VERSION = 7;

Review Comment:
   Does this belong to this class? Should this go to the common constant?



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/writer/impl/FixedByteChunkForwardIndexWriter.java:
##########
@@ -27,7 +27,8 @@
 /// Chunk-based raw (non-dictionary-encoded) forward index writer where each 
chunk contains fixed number of docs, and
 /// each entry has fixed number of bytes.
 @NotThreadSafe
-public class FixedByteChunkForwardIndexWriter extends 
BaseChunkForwardIndexWriter {
+public class FixedByteChunkForwardIndexWriter extends 
BaseChunkForwardIndexWriter

Review Comment:
   Annotate the override methods accordingly



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/writer/impl/FixedByteValueWriter.java:
##########
@@ -0,0 +1,53 @@
+/**
+ * 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.segment.local.io.writer.impl;
+
+import java.io.Closeable;
+import javax.annotation.concurrent.NotThreadSafe;
+
+
+/// Common write API for single-value fixed-width raw forward-index chunk 
writers, letting callers
+/// hold a single writer reference regardless of the on-disk format that backs 
it.
+///
+/// Two implementations exist, selected by the configured codec spec:
+/// - [FixedByteChunkForwardIndexWriter] — the legacy chunk format (versions 
2, 3, and arbitrary
+///   fixed-writer tags greater than or equal to 4); used for one plain 
`ChunkCompressionType`.
+///   Supports INT/LONG/FLOAT/DOUBLE.
+/// - [FixedByteChunkForwardIndexWriterV7] — the explicitly marked V7 
codec-pipeline format; used
+///   for every configured `codecSpec`. Supports INT/LONG only;
+///   `putFloat`/`putDouble` throw [UnsupportedOperationException].
+///
+/// Instances require serialized access and are not safe for concurrent use.
+@NotThreadSafe
+public interface FixedByteValueWriter extends Closeable {

Review Comment:
   We already have `VarByteChunkWriter`, consider naming this as 
`FixedByteChunkWriter`?



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