panhongan commented on code in PR #11296:
URL: https://github.com/apache/druid/pull/11296#discussion_r979180480
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClient.java:
##########
@@ -376,10 +385,47 @@ public ListenableFuture<DateTime> getStartTimeAsync(final
String id)
return doAsync(() -> getStartTime(id));
}
-
public ListenableFuture<Map<PartitionIdType, SequenceOffsetType>>
pauseAsync(final String id)
{
- return doAsync(() -> pause(id));
+ ListenableFuture<Map<PartitionIdType, SequenceOffsetType>> future =
doAsync(() -> pause(id));
+ pausingTaskFutureMap.put(id, new TaskPauseControlInfo(future, true));
+ return future;
+ }
+
+ public void cancelTaskPauseRequests()
+ {
+ for (Map.Entry<String, TaskPauseControlInfo> entry :
pausingTaskFutureMap.entrySet()) {
+ String taskId = entry.getKey();
+ TaskPauseControlInfo taskPauseControl = entry.getValue();
+
+ if (!taskPauseControl.getFuture().isDone()) {
+ this.stopPausingTask(taskId, taskPauseControl);
+ log.info("Cancel unfinished pause task [%s]", taskId);
+ } else {
+ log.info("Finished pause task [%s]", taskId);
+ }
+ }
+
+ pausingTaskFutureMap.clear();
+ }
+
+ @VisibleForTesting
+ public int getPauseFutureSize()
+ {
+ return pausingTaskFutureMap.size();
+ }
+
+ @VisibleForTesting
+ protected void stopPausingTask(String taskId, TaskPauseControlInfo
taskPauseControl)
Review Comment:
done, removed
--
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]