You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "imply-cheddar (via GitHub)" <gi...@apache.org> on 2024/08/06 15:01:37 UTC

Re: [PR] Refactor SemanticCreator (druid)

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-unsubscribe@druid.apache.org

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


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