This is an automated email from the ASF dual-hosted git repository.
sijie 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 31b7db6 Added executeOrdered to complement submitOrdered
31b7db6 is described below
commit 31b7db6dffd1eb3169e4304c9864462f56866fc9
Author: Matteo Merli <[email protected]>
AuthorDate: Tue Mar 27 23:33:01 2018 -0700
Added executeOrdered to complement submitOrdered
In many cases, we are not interested in the `ListenableFuture` returned by
`submitOrdered()` call. In these cases we can avoid creating the future object
which will be ignored by calling the `execute()` instead of `submit()` on the
underlying executor.
Author: Matteo Merli <[email protected]>
Reviewers: Ivan Kelly <[email protected]>, Enrico Olivelli
<[email protected]>, Sijie Guo <[email protected]>
This closes #1290 from merlimat/execute-ordered
---
.../org/apache/bookkeeper/common/util/OrderedScheduler.java | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git
a/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/OrderedScheduler.java
b/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/OrderedScheduler.java
index b24fb95..bf2a6fb 100644
---
a/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/OrderedScheduler.java
+++
b/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/OrderedScheduler.java
@@ -330,6 +330,16 @@ public class OrderedScheduler implements
ScheduledExecutorService {
}
/**
+ * schedules a one time action to execute with an ordering guarantee on
the <tt>orderingKey</tt>.
+ *
+ * @param orderingKey order key to submit the task
+ * @param r task to run
+ */
+ public void executeOrdered(Object orderingKey, SafeRunnable r) {
+ chooseThread(orderingKey).execute(timedRunnable(r));
+ }
+
+ /**
* schedules a one time action to execute with an ordering guarantee on
the key.
*
* @param orderingKey
--
To stop receiving notification emails like this one, please contact
[email protected].