imply-cheddar commented on code in PR #16700:
URL: https://github.com/apache/druid/pull/16700#discussion_r1705698776


##########
processing/src/main/java/org/apache/druid/segment/IndexIO.java:
##########
@@ -663,9 +650,32 @@ public QueryableIndex load(File inDir, ObjectMapper 
mapper, boolean lazy, Segmen
           segmentBitmapSerdeFactory.getBitmapFactory(),
           columns,
           smooshedFiles,
-          metadata,
           lazy
-      );
+      )
+      {
+        @Override
+        public Metadata getMetadata()
+        {
+          try {
+            ByteBuffer metadataBB = smooshedFiles.mapFile("metadata.drd");

Review Comment:
   Not necessarily.  The smooshedFiles is memory mapped and this is returning a 
memoized memory-mapped buffer.  It will do some less than fast operations, but 
not necessarily brand new disk IO.  The getMetadata() call is used seldom (only 
a few specific introspection-oriented calls like the segmentMetadata query) so 
it's better to have it be lazy and not consume on-heap memory.



-- 
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: commits-unsubscr...@druid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to