xiangfu0 commented on code in PR #19307:
URL: https://github.com/apache/pinot/pull/19307#discussion_r3890520054


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/codec/ChunkCodecHandler.java:
##########
@@ -49,6 +53,32 @@ interface ChunkCodecHandler<O extends CodecOptions> extends 
CodecDefinition<O> {
   /// @return encoded buffer ready for read; caller owns this buffer
   ByteBuffer encode(O options, CodecContext ctx, ByteBuffer src) throws 
IOException;
 
+  /// Encodes `src` directly into `dst`, avoiding an extra allocation.
+  /// Implementations must treat `dst` as freshly cleared and flip it before 
returning.
+  ///
+  /// The default implementation preserves the package-private test extension 
point by adapting
+  /// an allocation-returning [#encode()] implementation. Built-in handlers 
override it and write
+  /// directly into `dst`.
+  ///
+  /// @param options parsed options for this codec invocation
+  /// @param ctx     column context
+  /// @param src     unencoded data, ready for read
+  /// @param dst     output buffer; must have sufficient capacity
+  default void encodeInto(O options, CodecContext ctx, ByteBuffer src, 
ByteBuffer dst) throws IOException {

Review Comment:
   Renamed the required destination-based methods to `encode` and `decode`, and 
removed the default/allocating compatibility implementations. The codec runtime 
changes and real-codec coverage are isolated in #19397: 307 codec/parser tests 
pass in a separate prerequisite-only checkout, including destination contracts, 
bounded scratch lifecycle, corrupt frames, and shared-plan concurrency. V7 
consumes this API directly.



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