Maor Lipchuk has posted comments on this change.

Change subject: core: Add a query for attached Storage Domains
......................................................................


Patch Set 8:

(4 comments)

http://gerrit.ovirt.org/#/c/34233/8/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/GetStorageDomainsWithAttachedStoragePoolGuidQuery.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/GetStorageDomainsWithAttachedStoragePoolGuidQuery.java:

Line 33:         // Get a Host which is at UP state to connect to the Storage 
Domain.
Line 34:         List<VDS> hosts =
Line 35:                 
getDbFacade().getVdsDao().getAllForStoragePoolAndStatus(getParameters().getId(),
 VDSStatus.Up);
Line 36:         if (!hosts.isEmpty()) {
Line 37:             vdsId = RandomUtils.instance().pickRandom(hosts).getId();
> I agree, nice thinking btw with picking a random one from the collection bu
Added a log to indicate the chosen host.
This is the same logic as being done today, I didn't want to change it.
Line 38:         } else {
Line 39:             return;
Line 40:         }
Line 41: 


Line 35:                 
getDbFacade().getVdsDao().getAllForStoragePoolAndStatus(getParameters().getId(),
 VDSStatus.Up);
Line 36:         if (!hosts.isEmpty()) {
Line 37:             vdsId = RandomUtils.instance().pickRandom(hosts).getId();
Line 38:         } else {
Line 39:             return;
> Should we use getQueryReturnValue().setSucceeded(false) here so we will at 
It is set to false by default
Line 40:         }
Line 41: 
Line 42:         // Go over the list of Storage Domains and try to get the 
Storage Domain info to check if it attached to another
Line 43:         // Storage Pool


Line 43:         // Storage Pool
Line 44:         List<StorageDomain> storageDomains = 
getParameters().getStorageDomainList();
Line 45:         for (StorageDomain storageDomain : storageDomains) {
Line 46:             try {
Line 47:                 boolean connectResult = 
connectStorageDomain(storageDomain);
> We don't need to disconnect at some point?
done, added
Line 48:                 if (connectResult) {
Line 49:                     vdsReturnValue =
Line 50:                             
getVdsBroker().RunVdsCommand(VDSCommandType.HSMGetStorageDomainInfo,
Line 51:                                     new 
HSMGetStorageDomainInfoVDSCommandParameters(vdsId, storageDomain.getId()));


Line 72:         return 
StorageHelperDirector.getInstance().getItem(storageDomain.getStorageType())
Line 73:                 .connectStorageToDomainByVdsId(storageDomain, vdsId);
Line 74:     }
Line 75: 
Line 76:     private void printErrorMessage(StorageDomain storageDomain) {
> logErrorMessage would probably be a better name, as you aren'y really print
done.
log is not static
Line 77:         log.error("Could not get Storage Domain info for Storage 
Domain (name:'{}', id:'{}') with VDS '{}'. ",
Line 78:                 storageDomain.getName(),
Line 79:                 storageDomain.getId(),
Line 80:                 vdsId);


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id6fc7a2d722611b1bccecee9868223ff437596ed
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Tal Nisan <[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