You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/06/22 18:24:03 UTC

[GitHub] [pulsar] merlimat opened a new pull request, #16183: Use ExecutorService.execute() instead of submit() when possible

merlimat opened a new pull request, #16183:
URL: https://github.com/apache/pulsar/pull/16183

   ### Motivation
   
   `ExecutorService.submit()` creates and returns a `Future` object which is triggered when the task is complete. If we're not checking that future, we can use `execute()` instead which avoids the creation of the future.


-- 
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@pulsar.apache.org

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


[GitHub] [pulsar] merlimat merged pull request #16183: Use ExecutorService.execute() instead of submit() when possible

Posted by GitBox <gi...@apache.org>.
merlimat merged PR #16183:
URL: https://github.com/apache/pulsar/pull/16183


-- 
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@pulsar.apache.org

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


[GitHub] [pulsar] github-actions[bot] commented on pull request #16183: Use ExecutorService.execute() instead of submit() when possible

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #16183:
URL: https://github.com/apache/pulsar/pull/16183#issuecomment-1163464821

   @merlimat Please provide a correct documentation label for your PR.
   Instructions see [Pulsar Documentation Label Guide](https://docs.google.com/document/d/1Qw7LHQdXWBW9t2-r-A7QdFDBwmZh6ytB4guwMoXHqc0).


-- 
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@pulsar.apache.org

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


[GitHub] [pulsar] nodece commented on a diff in pull request #16183: Use ExecutorService.execute() instead of submit() when possible

Posted by GitBox <gi...@apache.org>.
nodece commented on code in PR #16183:
URL: https://github.com/apache/pulsar/pull/16183#discussion_r904457887


##########
tiered-storage/file-system/src/main/java/org/apache/bookkeeper/mledger/offload/filesystem/impl/FileStoreBackedReadHandleImpl.java:
##########
@@ -90,9 +90,10 @@ public LedgerMetadata getLedgerMetadata() {
     @Override
     public CompletableFuture<Void> closeAsync() {
         CompletableFuture<Void> promise = new CompletableFuture<>();
-        executor.submit(() -> {
+        executor.execute(() -> {
                 try {
                     reader.close();
+                    promise.complete(null);

Review Comment:
   The promise is complete in line 145.



##########
tiered-storage/file-system/src/main/java/org/apache/bookkeeper/mledger/offload/filesystem/impl/FileStoreBackedReadHandleImpl.java:
##########
@@ -90,9 +90,10 @@ public LedgerMetadata getLedgerMetadata() {
     @Override
     public CompletableFuture<Void> closeAsync() {
         CompletableFuture<Void> promise = new CompletableFuture<>();
-        executor.submit(() -> {
+        executor.execute(() -> {
                 try {
                     reader.close();
+                    promise.complete(null);

Review Comment:
   The promise is complete in line 144.



-- 
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@pulsar.apache.org

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