leventov commented on a change in pull request #4551: Fixes and improvements to 
SQL metadata caching.
URL: https://github.com/apache/incubator-druid/pull/4551#discussion_r247866248
 
 

 ##########
 File path: sql/src/main/java/io/druid/sql/calcite/schema/DruidSchema.java
 ##########
 @@ -59,42 +58,66 @@
 import io.druid.sql.calcite.view.DruidViewMacro;
 import io.druid.sql.calcite.view.ViewManager;
 import io.druid.timeline.DataSegment;
-import org.apache.calcite.schema.Function;
 import org.apache.calcite.schema.Table;
 import org.apache.calcite.schema.impl.AbstractSchema;
 import org.joda.time.DateTime;
 
+import java.io.IOException;
+import java.util.Comparator;
 import java.util.EnumSet;
-import java.util.List;
+import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.StreamSupport;
 
 @ManageLifecycle
 public class DruidSchema extends AbstractSchema
 {
+  // Newest segments first, so they override older ones.
 
 Review comment:
   The latter may not improve performance, but be necessary for #6827, because 
`segmentMetadataInfo` may need to become `ConcurrentHashMap<String, 
ConcurrentHashMap<DataSegment, SegmentMetadataHolder>>` to enable safe 
iteration concurrent with modification. Assuming that we want to avoid 
`ConcurrentSkipListMap` because it's not memory efficient and slow.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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