You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "kfaraz (via GitHub)" <gi...@apache.org> on 2023/05/02 06:57:32 UTC

[GitHub] [druid] kfaraz commented on a diff in pull request #13197: Segment loading: Allow cancellation and prioritization of load queue items

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


##########
server/src/main/java/org/apache/druid/server/coordinator/duty/EmitClusterStatsAndMetrics.java:
##########
@@ -322,18 +310,14 @@ private void emitStatsForHistoricalManagementDuties(DruidCluster cluster, Coordi
           );
         });
 
-    coordinator.computeNumsUnavailableUsedSegmentsPerDataSource().object2IntEntrySet().forEach(
-        (final Object2IntMap.Entry<String> entry) -> {
-          final String dataSource = entry.getKey();
-          final int numUnavailableUsedSegmentsInDataSource = entry.getIntValue();
-          emitter.emit(
-              new ServiceMetricEvent.Builder()
-                  .setDimension(DruidMetrics.DUTY_GROUP, groupName)
-                  .setDimension(DruidMetrics.DATASOURCE, dataSource).build(
-                  "segment/unavailable/count", numUnavailableUsedSegmentsInDataSource
-              )
-          );
-        }
+    coordinator.computeNumsUnavailableUsedSegmentsPerDataSource().forEach(

Review Comment:
   Style change: Use simpler iterator.



##########
server/src/main/java/org/apache/druid/server/coordinator/duty/RunRules.java:
##########
@@ -46,38 +45,16 @@ public class RunRules implements CoordinatorDuty
   private static final EmittingLogger log = new EmittingLogger(RunRules.class);
   private static final int MAX_MISSING_RULES = 10;
 
-  private final ReplicationThrottler replicatorThrottler;
+  private final SegmentStateManager stateManager;
 
-  private final DruidCoordinator coordinator;
-
-  public RunRules(DruidCoordinator coordinator)

Review Comment:
   Change summary:
   Move replication throttling logic to `SegmentStateManager`.
   Move check on `maxNonPrimaryReplicantsToLoad` to `ReplicationThrottler` (requires revisit).



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