<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 16 January 2017 at 16:30, Greg Sheremeta <span dir="ltr"><<a href="mailto:gshereme@redhat.com" target="_blank">gshereme@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="gmail-">On Mon, Jan 16, 2017 at 4:45 AM, Roy Golan <span dir="ltr"><<a href="mailto:rgolan@redhat.com" target="_blank">rgolan@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>Java EE 7 included ManageExecutorService in its spec. Using Wildfly (as certified EE 7 container) we can use it to replace our own ThreadPoolUtil implementation and (possibly) Quarz usage. <br><br></div>Managed executor service is a thread pool resource, manage by the container and can be controlled via JMX or the startup <a href="http://ovirt-egine.xml.in" target="_blank">ovirt-egine.xml.in</a> facility. This means that it could be tweaked at runtime as well. The service has configured thread factory and queue as well, all described by the xml<br><br></div><div>In the engine we are using mutli pools, with little to no capabilities of tweaking them<br>- ThreadPoolUtil - our general threading facade<br></div><div>- SchedulerThreadPool - the pool we create to pass to quarz<br>- HostUpdatesCheckerService.java - internal pool<br></div><div>- CommandExecutor - coco's pool<br><br></div><div>EE gave us a standard way to handle threads, with runtime configuration and ability to @inject it into the code, this means once again less code with using something the platform already supplies with real tuninig abilities. I know #infra has an item quarts, this should be considered as well.<br></div><div><br></div><div>Following this thread, if there is no suitable bug already, I'll open one for this.<br><br></div></div></blockquote></span></div></div></div></blockquote><div><br><a href="https://bugzilla.redhat.com/show_bug.cgi?id=1416141">https://bugzilla.redhat.com/show_bug.cgi?id=1416141</a><br><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div></div></blockquote><div><br></div></span><div>+1.</div><div><br></div><div>We started using this for the dashboard in a recent patch [3] by Scott:</div><div><br></div><div><div>@Resource</div><div>private ManagedScheduledExecutorServic<wbr>e scheduledExecutor;</div></div><div><br></div><div>[3] <a href="https://gerrit.ovirt.org/#/c/67709/7/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/dashboard/DashboardDataServlet.java" target="_blank">https://gerrit.ovirt.org/#/c/<wbr>67709/7/frontend/webadmin/<wbr>modules/frontend/src/main/<wbr>java/org/ovirt/engine/ui/<wbr>frontend/server/dashboard/<wbr>DashboardDataServlet.java</a><br></div><span class="gmail-"><div><br></div><div><br></div></span></div></div></div></blockquote><div>I used it here for POC [1] (in monitoring) and it works well. Just like quartz it support scheduling with a delay or with fixed rate and `ScheduledFuture` supports cancelling. <br></div><div>The only functionality that is missing if we want to replace also gluster usage is db store for triggers. I'm not why db store is need and I'd be happy if one of gluster members would be able to explain the need<br> <br><br></div><div>@Eldad regarding performance, it is not more perfomant as is(in the end quarz it thread pool). It will help us to manage resources better and that may hopefully prevent us from doing stuff wrong. (at least) <br><br></div><div>[1] <a href="https://gerrit.ovirt.org/#/c/70710/1">https://gerrit.ovirt.org/#/c/70710/1</a><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="gmail-"><div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>Some code snippets: <br></div><pre><code>@Resource
private ManagedExecutorService mes;<br></code></pre><pre><code>... Future f = mes.submit(() -> doThis())</code><br></pre><div><br></div><div>The configuration in <a href="http://ovirt-engine.xml.in" target="_blank">ovirt-engine.xml.in</a> (already there today!):<br></div></div></blockquote><div><br></div></span><div>Yep, added by [3] above :)</div></div></div></div></blockquote><div><br></div><div>+1 didn't run git-blame this time :) . <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-"><div dir="ltr"><div><br></div><div><div class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-container" title="Hint: double-click to select code"><div class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-line gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-number1 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-index0 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-alt2"><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain"><</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-keyword">managed-executor-services</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain">></code></div><div class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-line gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-number2 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-index1 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-alt1"><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-spaces"> </code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain"><</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-keyword">managed-executor-service</code></div><div class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-line gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-number3 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-index2 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-alt2"><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-spaces"> </code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-color1">name</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain">=</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-string">"default"</code></div><div class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-line gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-number4 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-index3 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-alt1"><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-spaces"> </code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-color1">jndi-name</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain">=</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-string">"java:jboss/ee/con<wbr>currency/executor/default"</code></div><div class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-line gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-number5 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-index4 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-alt2"><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-spaces"> </code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-color1">context-service</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain">=</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-string">"default"</code></div><div class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-line gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-number6 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-index5 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-alt1"><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-spaces"> </code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-color1">thread-factory</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain">=</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-string">"default"</code></div><div class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-line gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-number7 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-index6 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-alt2"><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-spaces"> </code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-color1">hung-task-threshold</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain">=</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-string">"60000"</code></div><div class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-line gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-number8 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-index7 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-alt1"><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-spaces"> </code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-color1">core-threads</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain">=</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-string">"5"</code></div><div class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-line gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-number9 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-index8 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-alt2"><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-spaces"> </code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-color1">max-threads</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain">=</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-string">"25"</code></div><div class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-line gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-number10 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-index9 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-alt1"><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-spaces"> </code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-color1">keepalive-time</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain">=</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-string">"5000"</code></div><div class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-line gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-number11 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-index10 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-alt2"><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-spaces"> </code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-color1">queue-length</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain">=</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-string">"1000000"</code></div><div class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-line gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-number12 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-index11 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-alt1"><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-spaces"> </code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-color1">reject-policy</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain">=</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-string">"RETRY_ABORT"</code> <code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain">/></code></div><div class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-line gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-number13 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-index12 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-alt2"><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain"></</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-keyword">managed-executor-services</code><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain">><br><br></code></div><div class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-line gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-number13 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-index12 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-alt2"><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain">Please head here for wildfly docs [1] and here [2] to see a simple example (from one of the members of the EG of EE, recommended blog in general)<br><br>[1] <a href="https://docs.jboss.org/author/display/WFLY8/EE+Concurrency+Utilities+Configuration" target="_blank">https://docs.jboss.org/author/<wbr>display/WFLY8/EE+Concurrency+U<wbr>tilities+Configuration</a><br>[2] <a href="http://www.adam-bien.com/roller/abien/entry/injecting_an_executorservice_with_java" target="_blank">http://www.adam-bien.com/rolle<wbr>r/abien/entry/injecting_an_<wbr>executorservice_with_java</a><br><br></code></div><div class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-line gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-number13 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-index12 gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-alt2"><code class="gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-xml gmail-m_3608236178506421658gmail-m_-986787202511607780gmail-plain"><br></code></div></div><br></div></div>
<br></span><span class="gmail-">______________________________<wbr>_________________<br>
Devel mailing list<br>
<a href="mailto:Devel@ovirt.org" target="_blank">Devel@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman<wbr>/listinfo/devel</a><br></span></blockquote></div><span class="gmail-HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="gmail-m_3608236178506421658gmail_signature"><div dir="ltr"><div>Greg Sheremeta, MBA<br>Red Hat, Inc.<br>Sr. Software Engineer<br><a href="mailto:gshereme@redhat.com" target="_blank">gshereme@redhat.com</a><br></div></div></div>
</font></span></div></div>
</blockquote></div><br></div></div>