kfaraz commented on code in PR #19648:
URL: https://github.com/apache/druid/pull/19648#discussion_r3508613972


##########
server/src/main/java/org/apache/druid/client/CachingClusteredClient.java:
##########
@@ -345,6 +345,19 @@ ClusterQueryResult<T> run(
       }
 
       final Set<SegmentServerSelector> segmentServers = 
computeSegmentsToQuery(timeline, specificSegments);
+      log.info("Query[%s] found [%d] segments from timeline lookup.", 
query.getId(), segmentServers.size());
+      if (query.context().isDebug()) {

Review Comment:
   Since this will happen only when `debug` is set to true in the context, I 
assume we would do it only in a test environment or while trying to debug a 
production cluster.
   
   In that case, could a query plan provide this info with the actual segment 
IDs that would be touched by the query?



##########
server/src/main/java/org/apache/druid/client/CachingClusteredClient.java:
##########
@@ -345,6 +345,19 @@ ClusterQueryResult<T> run(
       }
 
       final Set<SegmentServerSelector> segmentServers = 
computeSegmentsToQuery(timeline, specificSegments);
+      log.info("Query[%s] found [%d] segments from timeline lookup.", 
query.getId(), segmentServers.size());
+      if (query.context().isDebug()) {
+        segmentServers.stream()
+                      .collect(Collectors.groupingBy(
+                          s -> s.getSegmentDescriptor().getInterval()
+                               + "_" + s.getSegmentDescriptor().getVersion()
+                               + "_" + (s.getServer() != null && 
s.getServer().isRealtimeSegment() ? "realtime" : "historical"),
+                          Collectors.counting()

Review Comment:
   Instead of this, I think we might as well create a `SegmentId` and invoke 
`.toString()` on it.



##########
server/src/main/java/org/apache/druid/client/CachingClusteredClient.java:
##########
@@ -345,6 +345,19 @@ ClusterQueryResult<T> run(
       }
 
       final Set<SegmentServerSelector> segmentServers = 
computeSegmentsToQuery(timeline, specificSegments);
+      log.info("Query[%s] found [%d] segments from timeline lookup.", 
query.getId(), segmentServers.size());

Review Comment:
   +1



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