Sahina Bose has posted comments on this change.

Change subject: engine : Query to fetch list of volumes eligible for geo 
replication
......................................................................


Patch Set 6:

(2 comments)

http://gerrit.ovirt.org/#/c/33845/6/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetEligibleVolumesForGeoRepEnablingQuery.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetEligibleVolumesForGeoRepEnablingQuery.java:

Line 21:         Guid masterVolumeId = getParameters().getVolumeId();
Line 22:         GlusterVolumeEntity masterVolume = 
getGlusterVolumeDao().getById(masterVolumeId);
Line 23:         List<VDSGroup> vdsGroups = 
getDbFacade().getVdsGroupDao().getAll();
Line 24:         for (VDSGroup vdsGroup : vdsGroups) {
Line 25:             if (vdsGroup.getId() != masterVolume.getClusterId() && 
vdsGroup.getcompatibility_version().equals(getDbFacade().getVdsGroupDao().get(masterVolume.getClusterId()).getcompatibility_version())
 && vdsGroup.supportsGlusterService()) {
> Done
Looking at this again, you are getting the masterCluster from DB repeatedly in 
the loop. Shubhendu is right, you should be assigning this to a variable 
outside of the loop too.
Line 26:                 List<GlusterVolumeEntity> volumes = 
getGlusterVolumeDao().getByClusterId(vdsGroup.getId());
Line 27:                 for (GlusterVolumeEntity volume : volumes) {
Line 28:                     if (volume.getStatus() == GlusterStatus.UP && 
volume.getAdvancedDetails().getCapacityInfo().getUsedSize().equals(0L) && 
volume.getAdvancedDetails().getCapacityInfo().getFreeSize() >= 
masterVolume.getAdvancedDetails().getCapacityInfo().getUsedSize()) {
Line 29:                         eligibleVolumeList.add(volume);


Line 24:         for (VDSGroup vdsGroup : vdsGroups) {
Line 25:             if (vdsGroup.getId() != masterVolume.getClusterId() && 
vdsGroup.getcompatibility_version().equals(getDbFacade().getVdsGroupDao().get(masterVolume.getClusterId()).getcompatibility_version())
 && vdsGroup.supportsGlusterService()) {
Line 26:                 List<GlusterVolumeEntity> volumes = 
getGlusterVolumeDao().getByClusterId(vdsGroup.getId());
Line 27:                 for (GlusterVolumeEntity volume : volumes) {
Line 28:                     if (volume.getStatus() == GlusterStatus.UP && 
volume.getAdvancedDetails().getCapacityInfo().getUsedSize().equals(0L) && 
volume.getAdvancedDetails().getCapacityInfo().getFreeSize() >= 
masterVolume.getAdvancedDetails().getCapacityInfo().getUsedSize()) {
> Ok relaxing this for now. Will ask gluster folks in this regard.
volume.getAdvancedDetails().getCapacityInfo().getFreeSize()
>= masterVolume.getAdvancedDetails().getCapacityInfo().getUsedSize() ==> should 
>be
volume.getAdvancedDetails().getCapacityInfo().getTotalSize()
>= masterVolume.getAdvancedDetails().getCapacityInfo().getTotalSize()

right?
Line 29:                         eligibleVolumeList.add(volume);
Line 30:                     }
Line 31:                 }
Line 32:             }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0fc3ecb15535181f1ca2a8780461cb89788a3f41
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: anmolbabu <[email protected]>
Gerrit-Reviewer: Kanagaraj M <[email protected]>
Gerrit-Reviewer: Ramesh N <[email protected]>
Gerrit-Reviewer: Sahina Bose <[email protected]>
Gerrit-Reviewer: Shubhendu Tripathi <[email protected]>
Gerrit-Reviewer: anmolbabu <[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