Tal Nisan has submitted this change and it was merged.
Change subject: core: add executor for execution of runnables with CountDownLatch
......................................................................
core: add executor for execution of runnables with CountDownLatch
This patch adds LatchedRunnableExecuter to be able to execute
LatchedRunnableWrapper (pre existing class) instances using
CountDownLatch.
1. LatchedRunnableExecuter basically could have been implemented as
class whose instances cannot be created and with static methods only -
it's has been
implemented like this in order to provide proper testing (creating
instances of it is rare, so it shouldn't matter in terms of
garbage collection), a singleton isn't used as well as it's being used
only from Reconstruct flow which is rare,
so I prefer to create instance when needed instead of having permanent
instance of it.
2. Handle of rejected submission of runnables was removed last
patch because its abnormal situation that we shouldn't reach at all in
that case according to infra so there's no need to submit runnable again
if it failed.
3. Handle of InterruptedException : right now it's caught only as it's
being taken care of in other places in the code.
Change-Id: Ia56ff4afac01803ac0753dbf88fcfbfd34e2e56d
Signed-off-by: Liron Aravot <laravot(a)redhat.com>
---
A
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/thread/LatchedRunnableExecutor.java
M
backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/thread/LatchedRunnableWrapperTest.java
2 files changed, 167 insertions(+), 26 deletions(-)
Approvals:
Tal Nisan: Verified; Looks good to me, approved
--
To view, visit
http://gerrit.ovirt.org/10354
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia56ff4afac01803ac0753dbf88fcfbfd34e2e56d
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Aravot <laravot(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron(a)redhat.com>
Gerrit-Reviewer: Daniel Erez <derez(a)redhat.com>
Gerrit-Reviewer: Liron Aravot <laravot(a)redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipchuk(a)redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan(a)redhat.com>
Gerrit-Reviewer: Vered Volansky <vvolansk(a)redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs(a)redhat.com>