cku328 opened a new pull request #1146:
URL: https://github.com/apache/hadoop-ozone/pull/1146


   ## What changes were proposed in this pull request?
   
   Calling `CompletableFuture.cancel()` will mark the future as cancelled,but 
does not interrupt the running task.
   
   The Javadoc for the method 
[CompletableFuture#cancel()](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html#cancel-boolean-)
 states:
   ```
   Parameters:
   mayInterruptIfRunning - this value has no effect in this implementation 
because interrupts are not used to control processing.
   ```
   
   In this PR, I'm trying to make asynchronous tasks run in a specified thread 
pool by given the `executor` when using the `supplyAsync(...)` method.
   
   Finally, use `Executor.shutdownNow()` to interrupt the operation of putting 
key (_put<4,a>_).
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-2978
   
   ## How was this patch tested?
   
   Manual unit test 17000+ times -> Tests passed.
   
   
![image](https://user-images.githubusercontent.com/14295594/85982728-e4dea780-ba18-11ea-8782-e81a07d901bc.png)
   
   


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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to