anmolbabu has posted comments on this change.

Change subject: webadmin : Optimise for virt store on volumes
......................................................................


Patch Set 11:

(5 comments)

http://gerrit.ovirt.org/#/c/31041/11/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/volumes/VolumeListModel.java
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/volumes/VolumeListModel.java:

Line 807:         if (getSelectedItems() == null || getSelectedItems().size() 
== 0) {
Line 808:             return;
Line 809:         }
Line 810:         ArrayList<GlusterVolumeEntity> volumesForOptimiseForVirtStore 
= new ArrayList<GlusterVolumeEntity>();
Line 811:         ArrayList<GlusterVolumeEntity> discouragedConfigVolumes = new 
ArrayList<GlusterVolumeEntity>();
> boolean can be used instead list. defaults to false
Done
Line 812:         StringBuilder discouragedConfigVolumeNamesBuilder = new 
StringBuilder();
Line 813:         
discouragedConfigVolumeNamesBuilder.append(constants.optimiseForVirtStoreWarning());
Line 814:         for (Object item : getSelectedItems()) {
Line 815:             GlusterVolumeEntity volume = (GlusterVolumeEntity) item;


Line 814:         for (Object item : getSelectedItems()) {
Line 815:             GlusterVolumeEntity volume = (GlusterVolumeEntity) item;
Line 816:             volumesForOptimiseForVirtStore.add(volume);
Line 817:             if(volume.getReplicaCount() != 3) {
Line 818:                 discouragedConfigVolumes.add(volume);
> you could set the boolean to true here
Done
Line 819:                 
discouragedConfigVolumeNamesBuilder.append(volume.getName() + 
"\n");//$NON-NLS-1$
Line 820:             }
Line 821:         }
Line 822:         
discouragedConfigVolumeNamesBuilder.append(constants.optimiseForVirtStoreContinueMessage());


Line 820:             }
Line 821:         }
Line 822:         
discouragedConfigVolumeNamesBuilder.append(constants.optimiseForVirtStoreContinueMessage());
Line 823: 
Line 824:         if(discouragedConfigVolumes.size() > 0) {
> then check if the boolean is true
Done
Line 825:             ConfirmationModel cModel = new ConfirmationModel();
Line 826: 
Line 827:             
cModel.setMessage(discouragedConfigVolumeNamesBuilder.toString());
Line 828: 


Line 843: 
Line 844:     private void optimizeVolumesForVirtStore(final 
List<GlusterVolumeEntity> volumeList) {
Line 845:         if(getConfirmWindow() != null) {
Line 846:             setConfirmWindow(null);
Line 847:         }
> why is this required?
This was an existing function I only changed its signature from 
private void optimizeVolumesForVirtStore(final List<Guid> volumeList)
to 
private void optimizeVolumesForVirtStore(final List<GlusterVolumeEntity> 
volumeList) 
and a few lines accordingly 
+
the extra volume option network.pingtimeout
Line 848:         AsyncQuery aQuery = new AsyncQuery();
Line 849:         aQuery.setModel(this);
Line 850:         aQuery.asyncCallback = new INewAsyncCallback() {
Line 851:             @Override


Line 914:         List<GlusterVolumeOptionEntity> filteredOptions = 
volumeOptionsEnabled;
Line 915:         List<GlusterVolumeOptionEntity> tempFilteredOptions = 
volumeOptionsEnabled;
Line 916:         for(PredicateFilter<GlusterVolumeOptionEntity> predicate  : 
predicates) {
Line 917:              tempFilteredOptions = 
ListUtils.filter(volumeOptionsEnabled, predicate);
Line 918:              filteredOptions.retainAll(tempFilteredOptions);
> you could make this simple by
No my objective was to find intersection of the sets of entities(options here) 
that qualify each predicate.
i.e, find the list of only those entities() that pass the entire list of passed 
predicates
Line 919:         }
Line 920:         if(filteredOptions.size() > 0) {
Line 921:             return true;
Line 922:         }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6f995dec2258a3f5fc9673d5d075866b89f7773c
Gerrit-PatchSet: 11
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: anmolbabu <anb...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Kanagaraj M <kmayi...@redhat.com>
Gerrit-Reviewer: Sahina Bose <sab...@redhat.com>
Gerrit-Reviewer: Tal Nisan <tni...@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

Reply via email to