panhongan commented on code in PR #11296:
URL: https://github.com/apache/druid/pull/11296#discussion_r945818295
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskClient.java:
##########
@@ -376,10 +396,56 @@ public ListenableFuture<DateTime> getStartTimeAsync(final
String id)
return doAsync(() -> getStartTime(id));
}
-
public ListenableFuture<Map<PartitionIdType, SequenceOffsetType>>
pauseAsync(final String id)
{
- return doAsync(() -> pause(id));
+ PauseCallable pauseCallable = new PauseCallable(id, this);
+ ListenableFuture<Map<PartitionIdType, SequenceOffsetType>> future =
doAsync(pauseCallable);
+ pausingTaskFutureMap.put(future, pauseCallable);
+ return future;
+ }
+
+ public boolean stopUnfinishedPauseTasks()
+ {
+ for (Map.Entry<ListenableFuture<Map<PartitionIdType, SequenceOffsetType>>,
PauseCallable> entry : pausingTaskFutureMap.entrySet()) {
+ ListenableFuture<Map<PartitionIdType, SequenceOffsetType>> future =
entry.getKey();
+ PauseCallable pauseCallable = entry.getValue();
+
+ if (!future.isDone()) {
+ this.stopPausingTask(future, pauseCallable);
+ log.info("Stop unfinished pause task [%s]", pauseCallable.getTaskId());
+ } else {
+ log.info("Finished pause task [%s]", pauseCallable.getTaskId());
+ }
+ }
+
+ pausingTaskFutureMap.clear();
+ waitPausingTaskFinishedMap.clear();
+
+ return true;
Review Comment:
I thought `boolean type` can be easy to test. Now I change to `void` type.
--
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]