anmolbabu has posted comments on this change. Change subject: webadmin : Create Geo-rep pop up ......................................................................
Patch Set 26: (12 comments) Comments addressed in patch set 27 http://gerrit.ovirt.org/#/c/29691/26/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java: Line 1636: GlusterVolumeQueriesParameters parameters = new GlusterVolumeQueriesParameters(clusterId, volumeId); Line 1637: Frontend.getInstance().runQuery(VdcQueryType.GetGlusterVolumeRebalanceStatus, parameters, aQuery); Line 1638: } Line 1639: Line 1640: public void getVolumesForGeoRepCreate(AsyncQuery aQuery, Guid masterVolumeId, VdcQueryType vdcQueryType) { > vdcQueryType not being used This was intended to be a generic function replacing 2 cousins :) (2 similar signature functions). They differ only in the query being used. The 2 cousins :D are Query to get : 1. Eligible volume list 2. All Volumes list. But now that the default search query is being used I'll change this not to take as parameter. And its used below. Line 1641: aQuery.converterCallback = new IAsyncConverter() { Line 1642: @Override Line 1643: public Object Convert(Object returnValue, AsyncQuery asyncQuery) { Line 1644: return (returnValue != null) ? (Set<GlusterVolumeEntity>) returnValue : new HashSet<GlusterVolumeEntity>(); Line 1643: public Object Convert(Object returnValue, AsyncQuery asyncQuery) { Line 1644: return (returnValue != null) ? (Set<GlusterVolumeEntity>) returnValue : new HashSet<GlusterVolumeEntity>(); Line 1645: } Line 1646: }; Line 1647: aQuery.setHandleFailure(true); > Are you handling the failures? Letting the default backend triggered path to handle the failure. Setting it to false actually requires us to handle failure. Line 1648: Frontend.getInstance().runQuery(vdcQueryType, new IdQueryParameters(masterVolumeId), aQuery); Line 1649: } Line 1650: public void getGlusterVolumeProfilingStatistics(AsyncQuery aQuery, Guid clusterId, Guid volumeId, boolean nfs) { Line 1651: aQuery.setHandleFailure(true); http://gerrit.ovirt.org/#/c/29691/26/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/GlusterVolumeGeoRepCreateModel.java File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/GlusterVolumeGeoRepCreateModel.java: Line 45: registerSelectionHandlers(); Line 46: } Line 47: Line 48: protected void getVolumesForForceSessionCreate(final GlusterVolumeEntity masterVolume) { Line 49: final GlusterVolumeGeoRepCreateModel thisModel = this; > thisModel not being used It is used below in asyncquery onSuccess to stop progress Line 50: thisModel.startProgress(constants.fetchingDataMessage()); Line 51: AsyncQuery _asyncQuery = new AsyncQuery(); Line 52: _asyncQuery.setModel(this); Line 53: _asyncQuery.asyncCallback = new INewAsyncCallback() { Line 77: Line 78: private List<GlusterVolumeEntity> getVolumesInCluster(String cluster, Collection<GlusterVolumeEntity> volumes) { Line 79: List<GlusterVolumeEntity> volumesInCurrentCluster= new ArrayList<GlusterVolumeEntity>(); Line 80: for(GlusterVolumeEntity currentVolume : volumes) { Line 81: if(currentVolume.getVdsGroupName().equals(cluster)) { > Is it possible to have same cluster name in different data centers? This check is not to handle same cluster names in 2 different data centers But instead for the following reasons : 1. I have the list of volumes.(Eligible/All) 2. The first field on which the user would filter his selection is based on the cluster. 3. At this point I have a cluster being selected. 4. After a cluster is selected, what I want now is a list of volumes in my fetched list of volumes that belong to the selected cluster. 1,2,3 and 4 being the case the above approach is being used to resolve/handle it. Line 82: volumesInCurrentCluster.add(currentVolume); Line 83: } Line 84: } Line 85: return volumesInCurrentCluster; Line 109: } Line 110: } Line 111: }); Line 112: Line 113: IEventListener<EventArgs> clusterEvent = new IEventListener<EventArgs>() { > could be named as clusterEventListener Done Line 114: @Override Line 115: public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { Line 116: String selectedCluster = getSlaveClusters().getSelectedItem(); Line 117: List<GlusterVolumeEntity> volumesInCurrentCluster = new ArrayList<GlusterVolumeEntity>(); Line 123: }; Line 124: getSlaveClusters().getSelectedItemChangedEvent().addListener(clusterEvent); Line 125: getSlaveClusters().getItemsChangedEvent().addListener(clusterEvent); Line 126: Line 127: IEventListener<EventArgs> slaveVolumeEvent = new IEventListener<EventArgs>() { > same here Done Line 128: @Override Line 129: public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { Line 130: GlusterVolumeEntity selectedSlaveVolume = getSlaveVolumes().getSelectedItem(); Line 131: Set<String> hostsInCurrentVolume = new HashSet<String>(); http://gerrit.ovirt.org/#/c/29691/26/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeGeoRepListModel.java File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeGeoRepListModel.java: Line 146: private void updateActionAvailability(GlusterVolumeEntity volumeEntity) { Line 147: if(volumeEntity == null) { Line 148: return; Line 149: } Line 150: getNewSessionCommand().setIsAvailable(volumeEntity == null); > duplicate check Done Line 151: getRemoveSessionCommand().setIsAvailable(false); Line 152: getStartSessionCommand().setIsAvailable(false); Line 153: getStopSessionCommand().setIsAvailable(false); Line 154: getSessionOptionsCommand().setIsAvailable(false); Line 169: } else if(command.equals(getSessionOptionsCommand())) { Line 170: Line 171: } else if(command.equals(getViewSessionDetailsCommand())) { Line 172: Line 173: } else if(command.getName().equalsIgnoreCase("createSession")) {//$NON-NLS-1$ > should be named as onCreateSession Done Line 174: setWindow(null); Line 175: //Action to follow in next patch Line 176: } else if(command.getName().equalsIgnoreCase("close")) {//$NON-NLS-1$ Line 177: setWindow(null); Line 199: } Line 200: } Line 201: }); Line 202: } Line 203: */ > Remove the commented lines Done Line 204: private void createNewGeoRepSession() { Line 205: if(getWindow() != null || getEntity() == null) { Line 206: return; Line 207: } Line 238: Set<GlusterVolumeEntity> eligibleVolumesList = (Set<GlusterVolumeEntity>)returnValue; Line 239: geoRepCreateModel.setEligibleVolumeList(eligibleVolumesList); Line 240: geoRepCreateModel.getSlaveClusters().setItems(geoRepCreateModel.getClustersForVolume(eligibleVolumesList)); Line 241: Line 242: UICommand ok = new UICommand("createSession", geoRepModel);//$NON-NLS-1$ > you can do VolumeGeoRepListModel.this Done Line 243: ok.setTitle(constants.ok()); Line 244: ok.setIsDefault(true); Line 245: geoRepCreateModel.getCommands().add(ok); Line 246: } http://gerrit.ovirt.org/#/c/29691/26/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationMessages.java File frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationMessages.java: Line 111: @DefaultMessage("") Line 112: @AlternateMessage({ Line 113: "SLAVE_AND_MASTER_VOLUMES_IN_SAME_CLUSTER", "Slave and master volumes should not be from same cluster.", Line 114: "SLAVE_VOLUME_SIZE_NOT_GREATER_THAN_OR_EQUAL_TO_MASTER_VOLUME_SIZE", "Capacity of Slave volume should be greater than or equal to that of master volume.", Line 115: "SLAVE_CLUSTER_AND_MASTER_CLUSTER_COMPATIBILITY_VERSIONS_DO_NOT_MATCH", "Compatibility versions of slave and master volumes should be same.", > Cluster Compatibility version Done Line 116: "SLAVE_VOLUME_ALREADY_SLAVE_OF_ANOTHER_GEO_REP_SESSION", "Slave volume is already a part of another geo replication session.", Line 117: "SLAVE_VOLUME_NOT_UP", "Slave volume should be up.", Line 118: "SLAVE_VOLUME_ADVANCED_DETAILS_NOT_AVAILABLE", "Capacity information of the slave volume is not available.", Line 119: "MASTER_VOLUME_ADVANCED_DETAILS_NOT_AVAILABLE", "Capacity information of the master volume is not available." http://gerrit.ovirt.org/#/c/29691/26/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/GlusterVolumeGeoRepCreateSessionPopupView.java File frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/GlusterVolumeGeoRepCreateSessionPopupView.java: Line 208: public Object Convert(Object returnValue, AsyncQuery asyncQuery) { Line 209: return returnValue == null ? new ArrayList<GlusterGeoRepNonEligibilityReason>() : (List<GlusterGeoRepNonEligibilityReason>) returnValue; Line 210: } Line 211: }; Line 212: Frontend.getInstance().runQuery(VdcQueryType.GetEligibilityofVolumeForGeoRepSession, new GlusterVolumeGeoRepEligibilityParameters(masterVolume.getId(), slaveVolume.getId()), aQuery); > Fetching data should not be part of the view Done Line 213: } else { Line 214: suggestedConfigViolations.setVisible(false); Line 215: suggestedConfigViolations.setText(constants.empty()); Line 216: } -- To view, visit http://gerrit.ovirt.org/29691 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied7317d456bf66db9a7800ba7106f2e8ec66429c Gerrit-PatchSet: 26 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: anmolbabu <anb...@redhat.com> Gerrit-Reviewer: Kanagaraj M <kmayi...@redhat.com> Gerrit-Reviewer: Sahina Bose <sab...@redhat.com> Gerrit-Reviewer: anmolbabu <anb...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches