On Thu, Aug 23, 2018 at 6:35 AM Ivan Kelly <iv...@apache.org> wrote:

> >> We currently create an OrderedExecutor and an OrderedScheduler in the
> >> client. An OrderedScheduler is an OrderedExecutor. Moreover, it's very
> >> seldom used (basically for polling LAC, speculative reads and explicit
> >> flush.
> >
> > Why do they exist? Are they only legacy from past or is there any
> specific
> > reason?
>
> Accident I think.


I don't think it is accidently. OrderedExecutor has performance advantages
than OrderedScheduler.

A bit background on this:

- OrderedScheduler was introduced by me. And I changed existing
OrderedSafeExecutor to be extending from OrderedScheduler.
  Trying to standarize to one `OrderedScheduler`.
- I think Matteo noticed performance difference between `executor` and
`scheduler`, so he made the change

https://github.com/apache/bookkeeper/commit/46171e67e526702487641438144f28b7eb1aa07b
.

So the `executor` is used as the main callback executor, since it just
requires ordering but doesn't need scheduling capability.
the `scheduler` is used for scheduling tasks but doesn't require ordering.


> Previously, OrderedExecutor didn't implement
> scheduling, and BookKeeper had a ScheduledExecutorService member.
> This changed with
>
> https://github.com/apache/bookkeeper/commit/46171e67e526702487641438144f28b7eb1aa07b
> .
>
> > Is there any per ledger ordering requirement that we will break (or cause
> > deadlock) if we have a single queue per ledger?
>
> Any ordering that depends on this is broken. No operations should
> block on either of these executors, and I don't think any do.
>
> -Ivan
>

Reply via email to