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


##########
server/src/main/java/org/apache/druid/client/DataSourcesSnapshot.java:
##########
@@ -152,7 +309,9 @@ public Iterable<DataSegment> 
iterateAllUsedSegmentsInSnapshot()
    *
    * @return List of overshadowed segments
    */
-  private List<DataSegment> determineOvershadowedSegments()
+  private static ImmutableSet<DataSegment> determineOvershadowedSegments(
+      Map<String, ImmutableDruidDataSource> dataSourcesWithAllUsedSegments,
+      Map<String, SegmentTimeline> usedSegmentsTimelinesPerDataSource)

Review Comment:
   Nit: Please use proper formatting that is consistent with rest of the Druid 
code.
   
   



##########
server/src/main/java/org/apache/druid/client/CoordinatorServerView.java:
##########
@@ -60,16 +61,20 @@ public class CoordinatorServerView implements InventoryView
   private final CountDownLatch initialized = new CountDownLatch(1);
   private final ServiceEmitter emitter;
 
+  private final SqlSegmentsMetadataManager sqlSegmentsMetadataManager;
+
   @Inject
   public CoordinatorServerView(
       ServerInventoryView baseView,
       CoordinatorSegmentWatcherConfig segmentWatcherConfig,
-      ServiceEmitter emitter
+      ServiceEmitter emitter,
+      SqlSegmentsMetadataManager sqlSegmentsMetadataManager

Review Comment:
   Pass the interface `SegmentsMetadataManager` here instead of the concrete 
implementation.



##########
server/src/main/java/org/apache/druid/discovery/DruidLeaderClient.java:
##########
@@ -256,6 +265,80 @@ public String findCurrentLeader()
     );
   }
 
+  public InputStream getThingsFromLeaderNode(String query)
+  {
+    Request request;
+    InputStreamFullResponseHolder responseHolder;
+    try {
+      request = makeRequest(
+          HttpMethod.GET,

Review Comment:
   Nit: Don't break lines if the whole method call can fit within a single line.



##########
processing/src/main/java/org/apache/druid/timeline/DataSegmentChange.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.timeline;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.apache.druid.java.util.common.StringUtils;
+
+public class DataSegmentChange
+{
+  private final SegmentWithOvershadowedStatus segmentWithOvershadowedStatus;
+  private final boolean load;

Review Comment:
   I think `load` is false only when change type is `SEGMENT_REMOVED`, maybe we 
can get rid of the `load` field if it doesn't add any new info. 
   
   For convenience, you may still have an `isLoad` (maybe better named 
`isSegmentRemoved`) method but it should not be serializable (use @JsonIgnore 
if needed).



##########
server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataManager.java:
##########
@@ -164,6 +170,8 @@ long nanosElapsedFromInitiation()
    */
   private volatile @MonotonicNonNull DataSourcesSnapshot dataSourcesSnapshot = 
null;
 
+  private final Set<SegmentId> segmentHandedOffStatus = 
Sets.newConcurrentHashSet();

Review Comment:
   ```suggestion
     private final Set<SegmentId> handedOffSegments = 
Sets.newConcurrentHashSet();
   ```



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