This is an automated email from the ASF dual-hosted git repository.
zhaijia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push:
new 0fdbb06 Use final variables in BoundedScheduledExecutorService
0fdbb06 is described below
commit 0fdbb0622362849662b246a11b107c5f520060ad
Author: Matteo Merli <[email protected]>
AuthorDate: Sun Mar 18 15:55:57 2018 +0800
Use final variables in BoundedScheduledExecutorService
Make the fields final so that the optimizer can easily remove the `if
(maxTasksInQueue > 0) {}` branch when the limit on the executor is disabled.
Author: Matteo Merli <[email protected]>
Reviewers: Jia Zhai <None>, Sijie Guo <[email protected]>
This closes #1273 from merlimat/final-bounded-executor
---
.../bookkeeper/common/util/BoundedScheduledExecutorService.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
a/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/BoundedScheduledExecutorService.java
b/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/BoundedScheduledExecutorService.java
index b7b9151..482ca18 100644
---
a/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/BoundedScheduledExecutorService.java
+++
b/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/BoundedScheduledExecutorService.java
@@ -42,9 +42,9 @@ import java.util.concurrent.TimeoutException;
*/
public class BoundedScheduledExecutorService extends
ForwardingListeningExecutorService
implements ListeningScheduledExecutorService {
- BlockingQueue<Runnable> queue;
- ListeningScheduledExecutorService thread;
- int maxTasksInQueue;
+ private final BlockingQueue<Runnable> queue;
+ private final ListeningScheduledExecutorService thread;
+ private final int maxTasksInQueue;
public BoundedScheduledExecutorService(ScheduledThreadPoolExecutor thread,
int maxTasksInQueue) {
this.queue = thread.getQueue();
--
To stop receiving notification emails like this one, please contact
[email protected].