Alexander Wels has posted comments on this change. Change subject: webadmin: GuideMe can't activate hosts ......................................................................
Patch Set 2: (7 comments) https://gerrit.ovirt.org/#/c/39992/2/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/GuideModel.java File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/GuideModel.java: Line 92: getNote().setIsAvailable(false); Line 93: setConsoleHelpers(); Line 94: } Line 95: Line 96: public void cancel() {} This doesn't need to be public, it can be protected Line 97: Line 98: public void postAction() {} Line 99: Line 100: protected String getVdsSearchString(final MoveHost moveHost) { Line 94: } Line 95: Line 96: public void cancel() {} Line 97: Line 98: public void postAction() {} This doesn't need to be public it can be protected. Line 99: Line 100: protected String getVdsSearchString(final MoveHost moveHost) { Line 101: StringBuilder buf = new StringBuilder("Host: "); //$NON-NLS-1$ Line 102: int i = 0; Line 100: protected String getVdsSearchString(final MoveHost moveHost) { Line 101: StringBuilder buf = new StringBuilder("Host: "); //$NON-NLS-1$ Line 102: int i = 0; Line 103: for (MoveHostData hostData : moveHost.getSelectedHosts()) { Line 104: if (i > 0) { Instead of having the extra variable (i) you can check the length of the buffer, if (buf.length > 6) { Saves you having to add a new variable. Line 105: buf.append(" or "); //$NON-NLS-1$ Line 106: } Line 107: buf.append("name = "); //$NON-NLS-1$ Line 108: buf.append(hostData.getEntity().getName()); Line 112: } Line 113: Line 114: protected void checkVdsClusterChangeSucceeded(final GuideModel guideModel, Line 115: final String searchStr, Line 116: final ArrayList<VdcActionParametersBase> changeVdsParameterList, Does this have to be an ArrayList, can it be a List? Same with the other parameter? Line 117: final ArrayList<VdcActionParametersBase> activateVdsParameterList) { Line 118: final Map<Guid, Guid> hostClusterIdMap = new HashMap<>(); Line 119: for (VdcActionParametersBase param : changeVdsParameterList) { Line 120: hostClusterIdMap.put(((ChangeVDSClusterParameters) param).getVdsId(), Line 158: } Line 159: }; Line 160: Line 161: // Execute the timer to expire 5 seconds in the future Line 162: timer.schedule(5000); So what is the purpose of the timer? It appears we are waiting for 5 seconds before doing the operation, but why are we waiting that long, or what are we waiting for? Line 163: } Line 164: }, Line 165: this); Line 166: } https://gerrit.ovirt.org/#/c/39992/2/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterGuideModel.java File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterGuideModel.java: Line 355: @Override Line 356: public void executed(FrontendMultipleActionAsyncResult result) { Line 357: Line 358: final ClusterGuideModel clusterGuideModel = (ClusterGuideModel) result.getState(); Line 359: ArrayList<MoveHostData> hosts = ((MoveHost) clusterGuideModel.getWindow()).getSelectedHosts(); Do these have to be ArrayList? Line 360: ArrayList<VdcReturnValueBase> retVals = Line 361: (ArrayList<VdcReturnValueBase>) result.getReturnValue(); Line 362: final ArrayList<VdcActionParametersBase> activateVdsParameterList = new ArrayList<VdcActionParametersBase>(); Line 363: if (retVals != null && hosts.size() == retVals.size()) Line 389: public void run() { Line 390: checkVdsClusterChangeSucceeded(clusterGuideModel, searchString, parameterList, activateVdsParameterList); Line 391: } Line 392: }; Line 393: timer.schedule(2000); Why are we waiting here as well? Line 394: } Line 395: Line 396: } Line 397: }, -- To view, visit https://gerrit.ovirt.org/39992 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I983ad2c714ff945541de5f0b0d6f95e524f7edbc Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Ravi Nori <rn...@redhat.com> Gerrit-Reviewer: Alexander Wels <aw...@redhat.com> Gerrit-Reviewer: Einav Cohen <eco...@redhat.com> Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com> Gerrit-Reviewer: Ravi Nori <rn...@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