Sahina Bose has posted comments on this change. Change subject: engine : VdsCommand for geo-rep status detail query ......................................................................
Patch Set 6: (6 comments) http://gerrit.ovirt.org/#/c/30472/6/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/GlusterVolumeGeoRepStatusDetailForXmlRpc.java File backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/GlusterVolumeGeoRepStatusDetailForXmlRpc.java: Line 27: private static final String DELETES_PENDING = "deletesPending"; Line 28: private static final String FILES_SKIPPED = "filesSkipped"; Line 29: private static final String GEO_REP_PAIRS = "pairs"; Line 30: Line 31: private List<GlusterGeoRepSessionDetails> geoRepDetails = new ArrayList<GlusterGeoRepSessionDetails>(); > populatePairDetails(Map<String, Object> innerMap) is called per pair detai Pass the geoRepDetails and geoRepSessions to populatePairDetails so that this can be appended to in the method Line 32: private List<GlusterGeoRepSession> geoRepSessions = new ArrayList<GlusterGeoRepSession>(); Line 33: Line 34: private GlusterGeoRepSessionDetails details; Line 35: private GlusterGeoRepSession session; Line 30: Line 31: private List<GlusterGeoRepSessionDetails> geoRepDetails = new ArrayList<GlusterGeoRepSessionDetails>(); Line 32: private List<GlusterGeoRepSession> geoRepSessions = new ArrayList<GlusterGeoRepSession>(); Line 33: Line 34: private GlusterGeoRepSessionDetails details; This should be initialized in populatePairDetails instead of a class level variable. Line 35: private GlusterGeoRepSession session; Line 36: private String masterVolumeName; Line 37: private String sessionKey; Line 38: Line 39: private void populatePairDetails(Map<String, Object> innerMap) { Line 40: GlusterDBUtils dbUtils = GlusterDBUtils.getInstance(); Line 41: details = new GlusterGeoRepSessionDetails(); Line 42: session = new GlusterGeoRepSession(); Line 43: Guid masterNodeId = new Guid((innerMap.containsKey(MASTER_NODE_UUID)) ? innerMap.get(MASTER_NODE_UUID).toString() : null); if masternodeid is done, does it make sense to return the pair details? Shouldn't this be logged? Line 44: String masterBrick = (innerMap.containsKey(MASTER_BRICK)) ? innerMap.get(MASTER_BRICK).toString() : null; Line 45: String slave = innerMap.containsKey(SLAVE) ? innerMap.get(SLAVE).toString() : null; Line 46: String statusString = innerMap.containsKey(STATUS) ? innerMap.get(STATUS).toString() : null; Line 47: String checkPointStatusString = innerMap.containsKey(CHECKPOINT_STATUS) ? innerMap.get(CHECKPOINT_STATUS).toString() : null; Line 83: if(innerMap.containsKey(GEO_REP_PAIRS)) { Line 84: for(Object sessionPair : (Object[]) innerMap.get(GEO_REP_PAIRS)) { Line 85: populatePairDetails((Map<String, Object>) sessionPair); Line 86: geoRepDetails.add(details); Line 87: geoRepSessions.add(session); Wouldn't every session have multiple pair details? In this loop it looks like a one to one mapping Line 88: } Line 89: } Line 90: } Line 91: Line 93: super(innerMap); Line 94: populateSessionDetails(innerMap); Line 95: } Line 96: Line 97: public List<GlusterGeoRepSessionDetails> getGeoRepDetails() { No setters required here for geoRepDetails and geoRepSession Line 98: return geoRepDetails; Line 99: } Line 100: Line 101: public List<GlusterGeoRepSession> getGeoRepSessions() { http://gerrit.ovirt.org/#/c/30472/6/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/IVdsServer.java File backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/IVdsServer.java: Line 302: GlusterTasksListReturnForXmlRpc glusterTasksList(); Line 303: Line 304: GlusterVolumeTaskReturnForXmlRpc glusterVolumeRebalanceStatus(String volumeName); Line 305: Line 306: GlusterVolumeGeoRepStatusDetailForXmlRpc volumeGeoRepStatusDetail(String volumeName, String remoteHost, String remoteVolumeName); naming it slaveHost and slaveVolumeName would make more sense? Line 307: Line 308: GlusterVolumeTaskReturnForXmlRpc glusterVolumeRemoveBrickStatus(String volumeName, String[] bricksList); Line 309: Line 310: StatusOnlyReturnForXmlRpc setNumberOfCpus(String vmId, String numberOfCpus); -- To view, visit http://gerrit.ovirt.org/30472 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b8236e7e516eba46d183c3f83a973175edba90f 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
