You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Matt <mi...@gmail.com> on 2016/02/10 20:52:46 UTC

Review Request 43430: assign_master_component.js does not show recommendations while adding master component for a service which is already installed

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43430/
-----------------------------------------------------------

Review request for Ambari, Alexander Denissov, Alejandro Fernandez, Aleksandr Kovalenko, Alexandr Antonenko, bhuvnesh chaudhary, Goutam Tadi, Jaimin Jetly, jun aoki, Lav Jain, Newton Alex, Oleksandr Diachenko, and Sumit Mohanty.


Bugs: AMBARI-14987
    https://issues.apache.org/jira/browse/AMBARI-14987


Repository: ambari


Description
-------

On the assign masters page for the wizard, recommendations are not shown for a master component that is being added for an installed service.

This happens while adding HAWQSTANDBY to the cluster using the 'Add HAWQSTANDBY' wizard (situation: HAWQ service is already installed on the cluster). 
The fix might also solve the issue where there is a installed service and the upgrade of the service includes installing a new master component


Diffs
-----

  ambari-web/app/assets/test/tests.js 9d5cbc1 
  ambari-web/app/mixins/wizard/assign_master_components.js 7dc267e 
  ambari-web/test/controllers/wizard/step5_test.js b5e0ddb 
  ambari-web/test/mixins/wizard/assign_master_components_test.js PRE-CREATION 

Diff: https://reviews.apache.org/r/43430/diff/


Testing
-------

Manually Tested.

Unit test added:
  10385 tests complete (10 seconds)
  121 tests pending

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 37.278 s
[INFO] Finished at: 2016-02-10T11:52:05-08:00
[INFO] Final Memory: 12M/310M
[INFO] -----------------------------------------------------------------------


Thanks,

Matt


Re: Review Request 43430: assign_master_component.js does not show recommendations while adding master component for a service which is already installed

Posted by Goutam Tadi <go...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43430/#review118763
-----------------------------------------------------------


Ship it!




Ship It!

- Goutam Tadi


On Feb. 10, 2016, 7:52 p.m., Matt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43430/
> -----------------------------------------------------------
> 
> (Updated Feb. 10, 2016, 7:52 p.m.)
> 
> 
> Review request for Ambari, Alexander Denissov, Alejandro Fernandez, Aleksandr Kovalenko, Alexandr Antonenko, bhuvnesh chaudhary, Goutam Tadi, Jaimin Jetly, jun aoki, Lav Jain, Newton Alex, Oleksandr Diachenko, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-14987
>     https://issues.apache.org/jira/browse/AMBARI-14987
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On the assign masters page for the wizard, recommendations are not shown for a master component that is being added for an installed service.
> 
> This happens while adding HAWQSTANDBY to the cluster using the 'Add HAWQSTANDBY' wizard (situation: HAWQ service is already installed on the cluster). 
> The fix might also solve the issue where there is a installed service and the upgrade of the service includes installing a new master component
> 
> 
> Diffs
> -----
> 
>   ambari-web/app/assets/test/tests.js 9d5cbc1 
>   ambari-web/app/mixins/wizard/assign_master_components.js 7dc267e 
>   ambari-web/test/controllers/wizard/step5_test.js b5e0ddb 
>   ambari-web/test/mixins/wizard/assign_master_components_test.js PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/43430/diff/
> 
> 
> Testing
> -------
> 
> Manually Tested.
> 
> Unit test added:
>   10385 tests complete (10 seconds)
>   121 tests pending
> 
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 37.278 s
> [INFO] Finished at: 2016-02-10T11:52:05-08:00
> [INFO] Final Memory: 12M/310M
> [INFO] -----------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Matt
> 
>


Re: Review Request 43430: assign_master_component.js does not show recommendations while adding master component for a service which is already installed

Posted by Lav Jain <lj...@pivotal.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43430/#review118741
-----------------------------------------------------------


Ship it!




Ship It!

- Lav Jain


On Feb. 10, 2016, 7:52 p.m., Matt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43430/
> -----------------------------------------------------------
> 
> (Updated Feb. 10, 2016, 7:52 p.m.)
> 
> 
> Review request for Ambari, Alexander Denissov, Alejandro Fernandez, Aleksandr Kovalenko, Alexandr Antonenko, bhuvnesh chaudhary, Goutam Tadi, Jaimin Jetly, jun aoki, Lav Jain, Newton Alex, Oleksandr Diachenko, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-14987
>     https://issues.apache.org/jira/browse/AMBARI-14987
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On the assign masters page for the wizard, recommendations are not shown for a master component that is being added for an installed service.
> 
> This happens while adding HAWQSTANDBY to the cluster using the 'Add HAWQSTANDBY' wizard (situation: HAWQ service is already installed on the cluster). 
> The fix might also solve the issue where there is a installed service and the upgrade of the service includes installing a new master component
> 
> 
> Diffs
> -----
> 
>   ambari-web/app/assets/test/tests.js 9d5cbc1 
>   ambari-web/app/mixins/wizard/assign_master_components.js 7dc267e 
>   ambari-web/test/controllers/wizard/step5_test.js b5e0ddb 
>   ambari-web/test/mixins/wizard/assign_master_components_test.js PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/43430/diff/
> 
> 
> Testing
> -------
> 
> Manually Tested.
> 
> Unit test added:
>   10385 tests complete (10 seconds)
>   121 tests pending
> 
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 37.278 s
> [INFO] Finished at: 2016-02-10T11:52:05-08:00
> [INFO] Final Memory: 12M/310M
> [INFO] -----------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Matt
> 
>


Re: Review Request 43430: assign_master_component.js does not show recommendations while adding master component for a service which is already installed

Posted by Matt <mi...@gmail.com>.

> On Feb. 19, 2016, 10:57 a.m., Alexandr Antonenko wrote:
> > ambari-web/app/mixins/wizard/assign_master_components.js, line 776
> > <https://reviews.apache.org/r/43430/diff/3/?file=1252149#file1252149line776>
> >
> >     No need in such construction, there is native ember function pushObjects.

Thanks for reviewing Alexander


I've been having an issue with the unit test when I use `hostList.pushObjects(hostNames)`.
The existing unit test for `loadRecommendationsSuccessCallback` works when I use `Array.prototype.push.apply(hostList, hostNames);`
However, when I use `hostList.pushObjects(hostNames)`, the deep comparison `expect(c.get('content.recommendedHostsForComponents')).to.deep.equal(expected)` does not work, and the unit test keeps failing.

I tried changing the expect to use `to.deep.equal`, `to.eql`, `to.deep.eq` - neither of them worked.

Do you have any suggestions on how to get past this issue? 

As a last resort, I was planning to convert the result into JSON and compare it with an `expectedJSON`.


```
  describe('#loadRecommendationsSuccessCallback', function () {

    it('should set recommendations', function() {
      c.loadRecommendationsSuccessCallback(data);
      expect(c.get('content.recommendations')).to.eq(data.resources[0].recommendations);
    });

    it('should set recommendedHostsForComponents', function() {
      c.loadRecommendationsSuccessCallback(data);
      var expected = {
        "c1": ["h1", "h2", "h4", "h3"],
        "c3": ["h1"],
        "c2": ["h1", "h2", "h4"]
      };

      expect(c.get('content.recommendedHostsForComponents')).to.deep.equal(expected);
    });
  });
```


- Matt


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43430/#review119919
-----------------------------------------------------------


On Feb. 16, 2016, 2:13 p.m., Matt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43430/
> -----------------------------------------------------------
> 
> (Updated Feb. 16, 2016, 2:13 p.m.)
> 
> 
> Review request for Ambari, Alexander Denissov, Alejandro Fernandez, Aleksandr Kovalenko, Alexandr Antonenko, bhuvnesh chaudhary, Goutam Tadi, Jaimin Jetly, jun aoki, Lav Jain, Newton Alex, Oleksandr Diachenko, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-14987
>     https://issues.apache.org/jira/browse/AMBARI-14987
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On the assign masters page for the wizard, recommendations are not shown for a master component that is being added for an installed service.
> 
> This happens while adding HAWQSTANDBY to the cluster using the 'Add HAWQSTANDBY' wizard (situation: HAWQ service is already installed on the cluster).
> 
> The function getHostForMaster used to return the next available host for the master.
> For example:
> Case 1: component C1 is NOT installed on any hosts.
> getHostForMaster would return the first host from the allHosts list.
> Case 2: component C2 is installed on host H1
> getHostForMaster would return next available host from the allHosts list.
> If allHosts = ['H1', 'H2', 'H3']. It would return H2
> 
> To avoid just placing the component on the next available host, the recommendation is considered.
> Current implementation:
> If a host is recommended for the master, place it on that host (if it is not already installed on that host).
> If no recommendation is given, place it on the next available host.
> 
> 
> Diffs
> -----
> 
>   ambari-web/app/assets/test/tests.js 9d5cbc1 
>   ambari-web/app/mixins/wizard/assign_master_components.js f6d1b1a 
>   ambari-web/test/mixins/wizard/assign_master_components_test.js PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/43430/diff/
> 
> 
> Testing
> -------
> 
> Manually Tested.
> 
> Tested assign_master page on cluster installation, add service wizard, enable namenode wizard and add hawq standby wizard.
> 
> Unit test added:
>   10412 tests complete (9 seconds)
>   121 tests pending
> 
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 41.211 s
> [INFO] Finished at: 2016-02-16T14:12:45-08:00
> [INFO] Final Memory: 12M/311M
> [INFO] ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Matt
> 
>


Re: Review Request 43430: assign_master_component.js does not show recommendations while adding master component for a service which is already installed

Posted by Alexandr Antonenko <hi...@gmail.com>.

> On Feb. 19, 2016, 6:57 p.m., Alexandr Antonenko wrote:
> > ambari-web/app/mixins/wizard/assign_master_components.js, line 776
> > <https://reviews.apache.org/r/43430/diff/3/?file=1252149#file1252149line776>
> >
> >     No need in such construction, there is native ember function pushObjects.
> 
> Matt wrote:
>     Thanks for reviewing Alexander
>     
>     
>     I've been having an issue with the unit test when I use `hostList.pushObjects(hostNames)`.
>     The existing unit test for `loadRecommendationsSuccessCallback` works when I use `Array.prototype.push.apply(hostList, hostNames);`
>     However, when I use `hostList.pushObjects(hostNames)`, the deep comparison `expect(c.get('content.recommendedHostsForComponents')).to.deep.equal(expected)` does not work, and the unit test keeps failing.
>     
>     I tried changing the expect to use `to.deep.equal`, `to.eql`, `to.deep.eq` - neither of them worked.
>     
>     Do you have any suggestions on how to get past this issue? 
>     
>     As a last resort, I was planning to convert the result into JSON and compare it with an `expectedJSON`.
>     
>     
>     ```
>       describe('#loadRecommendationsSuccessCallback', function () {
>     
>         it('should set recommendations', function() {
>           c.loadRecommendationsSuccessCallback(data);
>           expect(c.get('content.recommendations')).to.eq(data.resources[0].recommendations);
>         });
>     
>         it('should set recommendedHostsForComponents', function() {
>           c.loadRecommendationsSuccessCallback(data);
>           var expected = {
>             "c1": ["h1", "h2", "h4", "h3"],
>             "c3": ["h1"],
>             "c2": ["h1", "h2", "h4"]
>           };
>     
>           expect(c.get('content.recommendedHostsForComponents')).to.deep.equal(expected);
>         });
>       });
>     ```

This is something that you will also see in future, and while using other functions, including native js function. If you do some modification with object or array, sometimes deep/equal return incorrect result. In that case please use JSON.stringify() and compare as plain text.
p.s. For deep equal please use eql()


- Alexandr


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43430/#review119919
-----------------------------------------------------------


On Feb. 16, 2016, 10:13 p.m., Matt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43430/
> -----------------------------------------------------------
> 
> (Updated Feb. 16, 2016, 10:13 p.m.)
> 
> 
> Review request for Ambari, Alexander Denissov, Alejandro Fernandez, Aleksandr Kovalenko, Alexandr Antonenko, bhuvnesh chaudhary, Goutam Tadi, Jaimin Jetly, jun aoki, Lav Jain, Newton Alex, Oleksandr Diachenko, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-14987
>     https://issues.apache.org/jira/browse/AMBARI-14987
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On the assign masters page for the wizard, recommendations are not shown for a master component that is being added for an installed service.
> 
> This happens while adding HAWQSTANDBY to the cluster using the 'Add HAWQSTANDBY' wizard (situation: HAWQ service is already installed on the cluster).
> 
> The function getHostForMaster used to return the next available host for the master.
> For example:
> Case 1: component C1 is NOT installed on any hosts.
> getHostForMaster would return the first host from the allHosts list.
> Case 2: component C2 is installed on host H1
> getHostForMaster would return next available host from the allHosts list.
> If allHosts = ['H1', 'H2', 'H3']. It would return H2
> 
> To avoid just placing the component on the next available host, the recommendation is considered.
> Current implementation:
> If a host is recommended for the master, place it on that host (if it is not already installed on that host).
> If no recommendation is given, place it on the next available host.
> 
> 
> Diffs
> -----
> 
>   ambari-web/app/assets/test/tests.js 9d5cbc1 
>   ambari-web/app/mixins/wizard/assign_master_components.js f6d1b1a 
>   ambari-web/test/mixins/wizard/assign_master_components_test.js PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/43430/diff/
> 
> 
> Testing
> -------
> 
> Manually Tested.
> 
> Tested assign_master page on cluster installation, add service wizard, enable namenode wizard and add hawq standby wizard.
> 
> Unit test added:
>   10412 tests complete (9 seconds)
>   121 tests pending
> 
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 41.211 s
> [INFO] Finished at: 2016-02-16T14:12:45-08:00
> [INFO] Final Memory: 12M/311M
> [INFO] ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Matt
> 
>


Re: Review Request 43430: assign_master_component.js does not show recommendations while adding master component for a service which is already installed

Posted by Matt <mi...@gmail.com>.

> On Feb. 19, 2016, 10:57 a.m., Alexandr Antonenko wrote:
> > ambari-web/app/mixins/wizard/assign_master_components.js, line 776
> > <https://reviews.apache.org/r/43430/diff/3/?file=1252149#file1252149line776>
> >
> >     No need in such construction, there is native ember function pushObjects.
> 
> Matt wrote:
>     Thanks for reviewing Alexander
>     
>     
>     I've been having an issue with the unit test when I use `hostList.pushObjects(hostNames)`.
>     The existing unit test for `loadRecommendationsSuccessCallback` works when I use `Array.prototype.push.apply(hostList, hostNames);`
>     However, when I use `hostList.pushObjects(hostNames)`, the deep comparison `expect(c.get('content.recommendedHostsForComponents')).to.deep.equal(expected)` does not work, and the unit test keeps failing.
>     
>     I tried changing the expect to use `to.deep.equal`, `to.eql`, `to.deep.eq` - neither of them worked.
>     
>     Do you have any suggestions on how to get past this issue? 
>     
>     As a last resort, I was planning to convert the result into JSON and compare it with an `expectedJSON`.
>     
>     
>     ```
>       describe('#loadRecommendationsSuccessCallback', function () {
>     
>         it('should set recommendations', function() {
>           c.loadRecommendationsSuccessCallback(data);
>           expect(c.get('content.recommendations')).to.eq(data.resources[0].recommendations);
>         });
>     
>         it('should set recommendedHostsForComponents', function() {
>           c.loadRecommendationsSuccessCallback(data);
>           var expected = {
>             "c1": ["h1", "h2", "h4", "h3"],
>             "c3": ["h1"],
>             "c2": ["h1", "h2", "h4"]
>           };
>     
>           expect(c.get('content.recommendedHostsForComponents')).to.deep.equal(expected);
>         });
>       });
>     ```
> 
> Alexandr Antonenko wrote:
>     This is something that you will also see in future, and while using other functions, including native js function. If you do some modification with object or array, sometimes deep/equal return incorrect result. In that case please use JSON.stringify() and compare as plain text.
>     p.s. For deep equal please use eql()

I've opened a new review after accomodating your feedback: https://reviews.apache.org/r/43812/

Thanks
Matt


- Matt


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43430/#review119919
-----------------------------------------------------------


On Feb. 16, 2016, 2:13 p.m., Matt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43430/
> -----------------------------------------------------------
> 
> (Updated Feb. 16, 2016, 2:13 p.m.)
> 
> 
> Review request for Ambari, Alexander Denissov, Alejandro Fernandez, Aleksandr Kovalenko, Alexandr Antonenko, bhuvnesh chaudhary, Goutam Tadi, Jaimin Jetly, jun aoki, Lav Jain, Newton Alex, Oleksandr Diachenko, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-14987
>     https://issues.apache.org/jira/browse/AMBARI-14987
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On the assign masters page for the wizard, recommendations are not shown for a master component that is being added for an installed service.
> 
> This happens while adding HAWQSTANDBY to the cluster using the 'Add HAWQSTANDBY' wizard (situation: HAWQ service is already installed on the cluster).
> 
> The function getHostForMaster used to return the next available host for the master.
> For example:
> Case 1: component C1 is NOT installed on any hosts.
> getHostForMaster would return the first host from the allHosts list.
> Case 2: component C2 is installed on host H1
> getHostForMaster would return next available host from the allHosts list.
> If allHosts = ['H1', 'H2', 'H3']. It would return H2
> 
> To avoid just placing the component on the next available host, the recommendation is considered.
> Current implementation:
> If a host is recommended for the master, place it on that host (if it is not already installed on that host).
> If no recommendation is given, place it on the next available host.
> 
> 
> Diffs
> -----
> 
>   ambari-web/app/assets/test/tests.js 9d5cbc1 
>   ambari-web/app/mixins/wizard/assign_master_components.js f6d1b1a 
>   ambari-web/test/mixins/wizard/assign_master_components_test.js PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/43430/diff/
> 
> 
> Testing
> -------
> 
> Manually Tested.
> 
> Tested assign_master page on cluster installation, add service wizard, enable namenode wizard and add hawq standby wizard.
> 
> Unit test added:
>   10412 tests complete (9 seconds)
>   121 tests pending
> 
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 41.211 s
> [INFO] Finished at: 2016-02-16T14:12:45-08:00
> [INFO] Final Memory: 12M/311M
> [INFO] ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Matt
> 
>


Re: Review Request 43430: assign_master_component.js does not show recommendations while adding master component for a service which is already installed

Posted by Alexandr Antonenko <hi...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43430/#review119919
-----------------------------------------------------------




ambari-web/app/mixins/wizard/assign_master_components.js (line 764)
<https://reviews.apache.org/r/43430/#comment181319>

    Ember has mapProperty function, there is no need to use map in this case.



ambari-web/app/mixins/wizard/assign_master_components.js (line 770)
<https://reviews.apache.org/r/43430/#comment181320>

    The same here, please use mapProperty



ambari-web/app/mixins/wizard/assign_master_components.js (line 776)
<https://reviews.apache.org/r/43430/#comment181326>

    No need in such construction, there is native ember function pushObjects.


- Alexandr Antonenko


On Feb. 16, 2016, 10:13 p.m., Matt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43430/
> -----------------------------------------------------------
> 
> (Updated Feb. 16, 2016, 10:13 p.m.)
> 
> 
> Review request for Ambari, Alexander Denissov, Alejandro Fernandez, Aleksandr Kovalenko, Alexandr Antonenko, bhuvnesh chaudhary, Goutam Tadi, Jaimin Jetly, jun aoki, Lav Jain, Newton Alex, Oleksandr Diachenko, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-14987
>     https://issues.apache.org/jira/browse/AMBARI-14987
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On the assign masters page for the wizard, recommendations are not shown for a master component that is being added for an installed service.
> 
> This happens while adding HAWQSTANDBY to the cluster using the 'Add HAWQSTANDBY' wizard (situation: HAWQ service is already installed on the cluster).
> 
> The function getHostForMaster used to return the next available host for the master.
> For example:
> Case 1: component C1 is NOT installed on any hosts.
> getHostForMaster would return the first host from the allHosts list.
> Case 2: component C2 is installed on host H1
> getHostForMaster would return next available host from the allHosts list.
> If allHosts = ['H1', 'H2', 'H3']. It would return H2
> 
> To avoid just placing the component on the next available host, the recommendation is considered.
> Current implementation:
> If a host is recommended for the master, place it on that host (if it is not already installed on that host).
> If no recommendation is given, place it on the next available host.
> 
> 
> Diffs
> -----
> 
>   ambari-web/app/assets/test/tests.js 9d5cbc1 
>   ambari-web/app/mixins/wizard/assign_master_components.js f6d1b1a 
>   ambari-web/test/mixins/wizard/assign_master_components_test.js PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/43430/diff/
> 
> 
> Testing
> -------
> 
> Manually Tested.
> 
> Tested assign_master page on cluster installation, add service wizard, enable namenode wizard and add hawq standby wizard.
> 
> Unit test added:
>   10412 tests complete (9 seconds)
>   121 tests pending
> 
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 41.211 s
> [INFO] Finished at: 2016-02-16T14:12:45-08:00
> [INFO] Final Memory: 12M/311M
> [INFO] ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Matt
> 
>


Re: Review Request 43430: assign_master_component.js does not show recommendations while adding master component for a service which is already installed

Posted by Matt <mi...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43430/
-----------------------------------------------------------

(Updated Feb. 16, 2016, 2:13 p.m.)


Review request for Ambari, Alexander Denissov, Alejandro Fernandez, Aleksandr Kovalenko, Alexandr Antonenko, bhuvnesh chaudhary, Goutam Tadi, Jaimin Jetly, jun aoki, Lav Jain, Newton Alex, Oleksandr Diachenko, and Sumit Mohanty.


Changes
-------

Change for loop


Bugs: AMBARI-14987
    https://issues.apache.org/jira/browse/AMBARI-14987


Repository: ambari


Description
-------

On the assign masters page for the wizard, recommendations are not shown for a master component that is being added for an installed service.

This happens while adding HAWQSTANDBY to the cluster using the 'Add HAWQSTANDBY' wizard (situation: HAWQ service is already installed on the cluster).

The function getHostForMaster used to return the next available host for the master.
For example:
Case 1: component C1 is NOT installed on any hosts.
getHostForMaster would return the first host from the allHosts list.
Case 2: component C2 is installed on host H1
getHostForMaster would return next available host from the allHosts list.
If allHosts = ['H1', 'H2', 'H3']. It would return H2

To avoid just placing the component on the next available host, the recommendation is considered.
Current implementation:
If a host is recommended for the master, place it on that host (if it is not already installed on that host).
If no recommendation is given, place it on the next available host.


Diffs (updated)
-----

  ambari-web/app/assets/test/tests.js 9d5cbc1 
  ambari-web/app/mixins/wizard/assign_master_components.js f6d1b1a 
  ambari-web/test/mixins/wizard/assign_master_components_test.js PRE-CREATION 

Diff: https://reviews.apache.org/r/43430/diff/


Testing (updated)
-------

Manually Tested.

Tested assign_master page on cluster installation, add service wizard, enable namenode wizard and add hawq standby wizard.

Unit test added:
  10412 tests complete (9 seconds)
  121 tests pending

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 41.211 s
[INFO] Finished at: 2016-02-16T14:12:45-08:00
[INFO] Final Memory: 12M/311M
[INFO] ------------------------------------------------------------------------


Thanks,

Matt


Re: Review Request 43430: assign_master_component.js does not show recommendations while adding master component for a service which is already installed

Posted by jun aoki <ju...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43430/#review119354
-----------------------------------------------------------




ambari-web/app/mixins/wizard/assign_master_components.js (line 872)
<https://reviews.apache.org/r/43430/#comment180668>

    This seems like it returns the host that matches the condition on line 874. Can we convine them together?
    pseudo code
    ```
    for (host in recommendedHostsForMaster){
      if !masterHostList.contains(host) {
        return host;
      }
    }
    ```


- jun aoki


On Feb. 16, 2016, 7:33 p.m., Matt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43430/
> -----------------------------------------------------------
> 
> (Updated Feb. 16, 2016, 7:33 p.m.)
> 
> 
> Review request for Ambari, Alexander Denissov, Alejandro Fernandez, Aleksandr Kovalenko, Alexandr Antonenko, bhuvnesh chaudhary, Goutam Tadi, Jaimin Jetly, jun aoki, Lav Jain, Newton Alex, Oleksandr Diachenko, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-14987
>     https://issues.apache.org/jira/browse/AMBARI-14987
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On the assign masters page for the wizard, recommendations are not shown for a master component that is being added for an installed service.
> 
> This happens while adding HAWQSTANDBY to the cluster using the 'Add HAWQSTANDBY' wizard (situation: HAWQ service is already installed on the cluster).
> 
> The function getHostForMaster used to return the next available host for the master.
> For example:
> Case 1: component C1 is NOT installed on any hosts.
> getHostForMaster would return the first host from the allHosts list.
> Case 2: component C2 is installed on host H1
> getHostForMaster would return next available host from the allHosts list.
> If allHosts = ['H1', 'H2', 'H3']. It would return H2
> 
> To avoid just placing the component on the next available host, the recommendation is considered.
> Current implementation:
> If a host is recommended for the master, place it on that host (if it is not already installed on that host).
> If no recommendation is given, place it on the next available host.
> 
> 
> Diffs
> -----
> 
>   ambari-web/app/assets/test/tests.js 9d5cbc1 
>   ambari-web/app/mixins/wizard/assign_master_components.js f6d1b1a 
>   ambari-web/test/mixins/wizard/assign_master_components_test.js PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/43430/diff/
> 
> 
> Testing
> -------
> 
> Manually Tested.
> 
> Tested assign_master page on cluster installation, add service wizard, enable namenode wizard and add hawq standby wizard.
> 
> Unit test added:
>   10410 tests complete (9 seconds)
>   121 tests pending
> 
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 54.125 s
> [INFO] Finished at: 2016-02-12T23:58:05-08:00
> [INFO] Final Memory: 12M/311M
> [INFO] ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Matt
> 
>


Re: Review Request 43430: assign_master_component.js does not show recommendations while adding master component for a service which is already installed

Posted by Matt <mi...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43430/
-----------------------------------------------------------

(Updated Feb. 16, 2016, 11:33 a.m.)


Review request for Ambari, Alexander Denissov, Alejandro Fernandez, Aleksandr Kovalenko, Alexandr Antonenko, bhuvnesh chaudhary, Goutam Tadi, Jaimin Jetly, jun aoki, Lav Jain, Newton Alex, Oleksandr Diachenko, and Sumit Mohanty.


Bugs: AMBARI-14987
    https://issues.apache.org/jira/browse/AMBARI-14987


Repository: ambari


Description
-------

On the assign masters page for the wizard, recommendations are not shown for a master component that is being added for an installed service.

This happens while adding HAWQSTANDBY to the cluster using the 'Add HAWQSTANDBY' wizard (situation: HAWQ service is already installed on the cluster).

The function getHostForMaster used to return the next available host for the master.
For example:
Case 1: component C1 is NOT installed on any hosts.
getHostForMaster would return the first host from the allHosts list.
Case 2: component C2 is installed on host H1
getHostForMaster would return next available host from the allHosts list.
If allHosts = ['H1', 'H2', 'H3']. It would return H2

To avoid just placing the component on the next available host, the recommendation is considered.
Current implementation:
If a host is recommended for the master, place it on that host (if it is not already installed on that host).
If no recommendation is given, place it on the next available host.


Diffs
-----

  ambari-web/app/assets/test/tests.js 9d5cbc1 
  ambari-web/app/mixins/wizard/assign_master_components.js f6d1b1a 
  ambari-web/test/mixins/wizard/assign_master_components_test.js PRE-CREATION 

Diff: https://reviews.apache.org/r/43430/diff/


Testing (updated)
-------

Manually Tested.

Tested assign_master page on cluster installation, add service wizard, enable namenode wizard and add hawq standby wizard.

Unit test added:
  10410 tests complete (9 seconds)
  121 tests pending

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 54.125 s
[INFO] Finished at: 2016-02-12T23:58:05-08:00
[INFO] Final Memory: 12M/311M
[INFO] ------------------------------------------------------------------------


Thanks,

Matt


Re: Review Request 43430: assign_master_component.js does not show recommendations while adding master component for a service which is already installed

Posted by Matt <mi...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43430/
-----------------------------------------------------------

(Updated Feb. 13, 2016, 12:06 a.m.)


Review request for Ambari, Alexander Denissov, Alejandro Fernandez, Aleksandr Kovalenko, Alexandr Antonenko, bhuvnesh chaudhary, Goutam Tadi, Jaimin Jetly, jun aoki, Lav Jain, Newton Alex, Oleksandr Diachenko, and Sumit Mohanty.


Changes
-------

Updated with better implementation. Added unit tests.


Bugs: AMBARI-14987
    https://issues.apache.org/jira/browse/AMBARI-14987


Repository: ambari


Description (updated)
-------

On the assign masters page for the wizard, recommendations are not shown for a master component that is being added for an installed service.

This happens while adding HAWQSTANDBY to the cluster using the 'Add HAWQSTANDBY' wizard (situation: HAWQ service is already installed on the cluster).

The function getHostForMaster used to return the next available host for the master.
For example:
Case 1: component C1 is NOT installed on any hosts.
getHostForMaster would return the first host from the allHosts list.
Case 2: component C2 is installed on host H1
getHostForMaster would return next available host from the allHosts list.
If allHosts = ['H1', 'H2', 'H3']. It would return H2

To avoid just placing the component on the next available host, the recommendation is considered.
Current implementation:
If a host is recommended for the master, place it on that host (if it is not already installed on that host).
If no recommendation is given, place it on the next available host.


Diffs (updated)
-----

  ambari-web/app/assets/test/tests.js 9d5cbc1 
  ambari-web/app/mixins/wizard/assign_master_components.js f6d1b1a 
  ambari-web/test/mixins/wizard/assign_master_components_test.js PRE-CREATION 

Diff: https://reviews.apache.org/r/43430/diff/


Testing (updated)
-------

Manually Tested.

Unit test added:
  10410 tests complete (9 seconds)
  121 tests pending

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 54.125 s
[INFO] Finished at: 2016-02-12T23:58:05-08:00
[INFO] Final Memory: 12M/311M
[INFO] ------------------------------------------------------------------------


Thanks,

Matt