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


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/writer/impl/MutableOffHeapByteArrayStore.java:
##########
@@ -90,6 +90,14 @@ private static class Buffer implements Closeable {
 
     private int _numValues = 0;
     private int _availEndOffset;  // Exclusive
+    /// Read-only view of the whole region, so that [#getByteBuffer] can hand 
out a value view with a single `slice`
+    /// rather than the `duplicate` + `slice` + `asReadOnlyBuffer` chain 
building one from scratch costs. Reads on the
+    /// consuming MAP path go through here once per row per projected key, so 
those allocations add up.
+    ///
+    /// Built on first use rather than up front, so a store that is never read 
this way - every dictionary and every
+    /// non-MAP raw column - behaves exactly as before. Racing readers may 
each build one; they are interchangeable,
+    /// and the field is volatile so a reader never sees a half-initialized 
buffer.
+    private volatile ByteBuffer _readOnlyView;

Review Comment:
   Yes, please go ahead with the split



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