Copilot commented on code in PR #18467:
URL: https://github.com/apache/druid/pull/18467#discussion_r2315801206
##########
multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQWorkerTaskLauncher.java:
##########
@@ -149,37 +152,64 @@ private enum State
private final Set<Integer> failedInactiveWorkers =
ConcurrentHashMap.newKeySet();
private final ConcurrentHashMap<Integer, List<String>> workerToTaskIds = new
ConcurrentHashMap<>();
- private final AtomicReference<WorkerFailureListener>
workerFailureListenerRef = new AtomicReference<>();
+ private final WorkerFailureListener workerFailureListener;
private final AtomicLong recentFullyStartedWorkerTimeInMillis = new
AtomicLong(System.currentTimeMillis());
+ private final long taskIdsLockTimeout;
+
public MSQWorkerTaskLauncher(
final String controllerTaskId,
final String dataSource,
final OverlordClient overlordClient,
+ final WorkerFailureListener workerFailureListener,
final Map<String, Object> taskContextOverrides,
final long maxTaskStartDelayMillis,
final MSQWorkerTaskLauncherConfig config
)
+ {
+ this(
+ controllerTaskId,
+ dataSource,
+ overlordClient,
+ workerFailureListener,
+ taskContextOverrides,
+ maxTaskStartDelayMillis,
+ config,
+ TimeUnit.SECONDS.toMillis(60)
+ );
+ }
+
+ @VisibleForTesting
+ protected MSQWorkerTaskLauncher(
+ final String controllerTaskId,
+ final String dataSource,
+ final OverlordClient overlordClient,
+ final WorkerFailureListener workerFailureListener,
+ final Map<String, Object> taskContextOverrides,
+ final long maxTaskStartDelayMillis,
+ final MSQWorkerTaskLauncherConfig config,
+ final long taskIdsLockTimeout
+ )
{
this.controllerTaskId = controllerTaskId;
this.dataSource = dataSource;
this.overlordClient = overlordClient;
+ this.workerFailureListener = workerFailureListener;
this.taskContextOverrides = taskContextOverrides;
this.exec = Execs.singleThreaded(
"multi-stage-query-task-launcher[" +
StringUtils.encodeForFormat(controllerTaskId) + "]-%s"
);
this.maxTaskStartDelayMillis = maxTaskStartDelayMillis;
this.config = config;
+ this.taskIdsLockTimeout = taskIdsLockTimeout;
}
+
+
Review Comment:
[nitpick] Remove the extra blank lines. There should be only one blank line
between methods.
```suggestion
```
--
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]