liron aravot has posted comments on this change.

Change subject: core: Adding support for completion service for ThreadPoolUtil
......................................................................


Patch Set 1: Looks good to me, but someone else must approve

(2 inline comments)

....................................................
File 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/threadpool/ThreadPoolUtil.java
Line 87:      * concurrently, and use a blocking queue like interface to get 
the tasks
Line 88:      * @param tasks collection of tasks (callable objects) to submit
Line 89:      * @return
Line 90:      */
Line 91:     public static <V> ExecutorCompletionService<V> 
getCompletionService(Collection<Callable<V>> tasks) {
consider having it as Iterable rather then Collection when you rebase..
Line 92:          ExecutorCompletionService<V> ecs =  getCompletionService();
Line 93:          if (tasks == null) {
Line 94:              return ecs;
Line 95:          }


Line 89:      * @return
Line 90:      */
Line 91:     public static <V> ExecutorCompletionService<V> 
getCompletionService(Collection<Callable<V>> tasks) {
Line 92:          ExecutorCompletionService<V> ecs =  getCompletionService();
Line 93:          if (tasks == null) {
I'd change the if to  "if (tasks != null)" and wrap the for each loop with it, 
so you'll avoid some lines here and will have only one return statement
Line 94:              return ecs;
Line 95:          }
Line 96:          for (Callable<V> callable:tasks) {
Line 97:              ecs.submit(callable);


--
To view, visit http://gerrit.ovirt.org/10439
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If806302ecf028a5db1c9726a407a1643b5c000b6
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Liron Aravot <lara...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: liron aravot <liron.ara...@gmail.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to