pzhdfy commented on a change in pull request #6988: [Improvement] historical 
fast restart by lazy load columns metadata(20X faster)
URL: https://github.com/apache/incubator-druid/pull/6988#discussion_r351275292
 
 

 ##########
 File path: processing/src/main/java/org/apache/druid/segment/IndexIO.java
 ##########
 @@ -449,59 +455,71 @@ public QueryableIndex load(File inDir, ObjectMapper 
mapper) throws IOException
         if (index.getSpatialIndexes().get(dimension) != null) {
           builder.setSpatialIndex(new 
SpatialIndexColumnPartSupplier(index.getSpatialIndexes().get(dimension)));
         }
-        columns.put(
-            dimension,
-            builder.build()
-        );
+        if (lazy) {
+          columns.put(dimension, Suppliers.memoize(() -> builder.build()));
+        } else {
+          ColumnHolder columnHolder = builder.build();
+          columns.put(dimension, () -> columnHolder);
+        }
 
 Review comment:
   done

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to