Tal Nisan has posted comments on this change.

Change subject: bll: remove usage of RandomUtils
......................................................................


Patch Set 3:

(2 comments)

http://gerrit.ovirt.org/#/c/35217/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageHandlingCommandBase.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageHandlingCommandBase.java:

Line 147:         List<VDS> hosts = 
getVdsDAO().getAllForStoragePoolAndStatus(getStoragePool().getId(),
Line 148:                 VDSStatus.Up);
Line 149:         if (!hosts.isEmpty()) {
Line 150:             try {
Line 151:                 return 
hosts.get(SecureRandom.getInstance("SHA1PRNG").nextInt(hosts.size()));
Isn't it a bit hardcore for a mere selection of a random host for the pool just 
because we don't care which host it will be?
I'm all in favor of removing RandonUtils though
Line 152:             } catch (NoSuchAlgorithmException e) {
Line 153:                 throw new RuntimeException(e);
Line 154:             }
Line 155:         }


http://gerrit.ovirt.org/#/c/35217/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/ClusterUtils.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/ClusterUtils.java:

Line 34:         if (servers == null || servers.isEmpty()) {
Line 35:             return null;
Line 36:         }
Line 37:         try {
Line 38:             return 
servers.get(SecureRandom.getInstance("SHA1PRNG").nextInt(servers.size()));
Same here
Line 39:         } catch (NoSuchAlgorithmException e) {
Line 40:             throw new RuntimeException(e);
Line 41:         }
Line 42:     }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id20da6d8eb93ebbd237d20705440c5e583fc486e
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to