Kanagaraj M has posted comments on this change. Change subject: engine : Query to fetch list of volumes eligible for geo replication ......................................................................
Patch Set 18: (5 comments) http://gerrit.ovirt.org/#/c/33845/18/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/GlusterGeoRepUtil.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/GlusterGeoRepUtil.java: Line 18: public static GlusterGeoRepUtil getInstance() { Line 19: return instance; Line 20: } Line 21: Line 22: public List<GlusterGeoRepNonEligibilityReason> getNonEligibilityReasons(GlusterVolumeEntity masterVolume, GlusterVolumeEntity currentVolume) { can we call this as 'slaveVolume' instead of 'currentVolume'? Line 23: List<GlusterGeoRepSession> existingSessions = getGlusterGeoRepDao().getAllSessions(); Line 24: List<Guid> sessionSlavesIds = new ArrayList<Guid>(); Line 25: for(GlusterGeoRepSession currentSession : existingSessions) { Line 26: sessionSlavesIds.add(currentSession.getSlaveVolumeId()); Line 24: List<Guid> sessionSlavesIds = new ArrayList<Guid>(); Line 25: for(GlusterGeoRepSession currentSession : existingSessions) { Line 26: sessionSlavesIds.add(currentSession.getSlaveVolumeId()); Line 27: } Line 28: List<GlusterGeoRepNonEligibilityReason> criteriaViolatingSuggestedConfig = new ArrayList<GlusterGeoRepNonEligibilityReason>(); This can be renamed as nonEligibilityReasons Line 29: if(currentVolume.getClusterId().equals(masterVolume.getClusterId())) { Line 30: criteriaViolatingSuggestedConfig.add(GlusterGeoRepNonEligibilityReason.SLAVE_AND_MASTER_VOLUMES_IN_SAME_CLUSTER); Line 31: } Line 32: if(sessionSlavesIds.contains(currentVolume.getId())) { Line 37: } Line 38: if(masterVolume.getAdvancedDetails().getCapacityInfo() == null || masterVolume.getAdvancedDetails().getCapacityInfo().getTotalSize() == null) { Line 39: criteriaViolatingSuggestedConfig.add(GlusterGeoRepNonEligibilityReason.MASTER_VOLUME_ADVANCED_DETAILS_NOT_AVAILABLE); Line 40: } Line 41: if(currentVolume.getAdvancedDetails().getCapacityInfo() != null && masterVolume.getAdvancedDetails().getCapacityInfo() != null && currentVolume.getAdvancedDetails().getCapacityInfo().getTotalSize() != null && masterVolume.getAdvancedDetails().getCapacityInfo().getTotalSize() != null && currentVolume.getAdvancedDetails().getCapacityInfo().getTotalSize() < masterVolume.getAdvancedDetails().getCapacityInfo().getTotalSize()) { currentVolume.getAdvancedDetails().getCapacityInfo()!= null is a duplicated check. Also you can extract currentVolume.getAdvancedDetails().getCapacityInfo() and masterVolume.getAdvancedDetails().getCapacityInfo() to local variable, this will make the code easier to read Line 42: criteriaViolatingSuggestedConfig.add(GlusterGeoRepNonEligibilityReason.SLAVE_VOLUME_SIZE_NOT_GREATER_THAN_OR_EQUAL_TO_MASTER_VOLUME_SIZE); Line 43: } Line 44: if(currentVolume.getStatus() != GlusterStatus.UP) { Line 45: criteriaViolatingSuggestedConfig.add(GlusterGeoRepNonEligibilityReason.SLAVE_VOLUME_NOT_UP); http://gerrit.ovirt.org/#/c/33845/18/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterGeoRepNonEligibilityReason.java File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterGeoRepNonEligibilityReason.java: Line 6: SLAVE_CLUSTER_AND_MASTER_CLUSTER_COMPATIBILITY_VERSIONS_DO_NOT_MATCH, Line 7: SLAVE_VOLUME_ALREADY_SLAVE_OF_ANOTHER_GEO_REP_SESSION, Line 8: SLAVE_VOLUME_NOT_UP, Line 9: SLAVE_VOLUME_ADVANCED_DETAILS_NOT_AVAILABLE, Line 10: MASTER_VOLUME_ADVANCED_DETAILS_NOT_AVAILABLE; We can call these as SLAVE_VOLUME_SIZE_NOT_AVAILABLE and MASTER_VOLUME_SIZE_NOT_AVAILABLE http://gerrit.ovirt.org/#/c/33845/18/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java: Line 333: GetGlusterVolumeRebalanceStatus, Line 334: GetGlusterVolumeGeoRepSessions, Line 335: GetGlusterVolumeRemoveBricksStatus, Line 336: GetGlusterVolumeByTaskId, Line 337: GetEligibilityofVolumeForGeoRepSession, I feel the name of the query is contracting with what is actually returned(non-eligibility reasons). Line 338: GetGlusterGeoReplicationEligibleVolumes, Line 339: Line 340: GetDefaultConfigurationVersion(VdcQueryAuthType.User), Line 341: OsRepository(VdcQueryAuthType.User), -- 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: 18 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: anmolbabu <[email protected]> Gerrit-Reviewer: Eli Mesika <[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: Yair Zaslavsky <[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
