Re: Review Request 49557: Hive Database URL config updated by Ambari stack advisor recommendation

2016-07-02 Thread Sumit Mohanty

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


Ship it!




Ship It!

- Sumit Mohanty


On July 2, 2016, 5:39 p.m., Vitalyi Brodetskyi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49557/
> ---
> 
> (Updated July 2, 2016, 5:39 p.m.)
> 
> 
> Review request for Ambari and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-17491
> https://issues.apache.org/jira/browse/AMBARI-17491
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> Stack advisor recommeds to update host in Hive/Oozie db connection url when 
> we don't need that.
> 
> 
> Diffs
> -
> 
>   ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py 
> 3d6ca4c 
>   ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py 
> abea76e 
> 
> Diff: https://reviews.apache.org/r/49557/diff/
> 
> 
> Testing
> ---
> 
> mvn clean test
> 
> 
> Thanks,
> 
> Vitalyi Brodetskyi
> 
>



Re: Review Request 49557: Hive Database URL config updated by Ambari stack advisor recommendation

2016-07-02 Thread Vitalyi Brodetskyi


> On Липень 2, 2016, 4:42 після полудня, Sumit Mohanty wrote:
> > ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py, line 
> > 210
> > 
> >
> > Can we add one test with the value changed by stack advisor?

Below in this test you can see such validations, they are validating my code too
# new mysql
self.stackAdvisor.recommendHiveConfigurations(configurations, clusterData, 
services, hosts)

self.assertEquals(configurations['hive-site']['properties']['javax.jdo.option.ConnectionURL'],
 "jdbc:mysql://example.com/hive_name?createDatabaseIfNotExist=true")

self.assertEquals(configurations['hive-site']['properties']['javax.jdo.option.ConnectionDriverName'],
 "com.mysql.jdbc.Driver")

# existing Mysql
services['configurations']['hive-env']['properties']['hive_database'] = 
'Existing MySQL Database'
self.stackAdvisor.recommendHiveConfigurations(configurations, clusterData, 
services, hosts)

self.assertEquals(configurations['hive-site']['properties']['javax.jdo.option.ConnectionURL'],
 "jdbc:mysql://example.com/hive_name")

self.assertEquals(configurations['hive-site']['properties']['javax.jdo.option.ConnectionDriverName'],
 "com.mysql.jdbc.Driver")

# existing postgres
services['configurations']['hive-env']['properties']['hive_database'] = 
'Existing PostgreSQL Database'
self.stackAdvisor.recommendHiveConfigurations(configurations, clusterData, 
services, hosts)

self.assertEquals(configurations['hive-site']['properties']['javax.jdo.option.ConnectionURL'],
 "jdbc:postgresql://example.com:5432/hive_name")

self.assertEquals(configurations['hive-site']['properties']['javax.jdo.option.ConnectionDriverName'],
 "org.postgresql.Driver")


> On Липень 2, 2016, 4:42 після полудня, Sumit Mohanty wrote:
> > ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py, 
> > line 193
> > 
> >
> > Rename it to getProtocol?

done


> On Липень 2, 2016, 4:42 після полудня, Sumit Mohanty wrote:
> > ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py, 
> > line 99
> > 
> >
> > Lets split it for readability
> > enclose the whole logic under "if hiveServerHost is not None"
> > 
> > Why does schema name matter?
> > 
> > Do we need to read oldDBType - if its not set would 
> > firstPartofDBConnectionURL be non None?

"Split" - done
"Why does schema name matter?" - because when user changing schema name in 
related field, it should be updated in URL too. We have this logic before.
"Do we need to read oldDBType - if its not set would firstPartofDBConnectionURL 
be non None?" - we need to call update url code when db type was changed from 
"new mysql" -> "existing mysql" too. Because URL for these two cases are 
different. For "new mysql" url contain parameter "CreateDBIfNotExist=true"


- Vitalyi


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


On Липень 2, 2016, 5:39 після полудня, Vitalyi Brodetskyi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49557/
> ---
> 
> (Updated Липень 2, 2016, 5:39 після полудня)
> 
> 
> Review request for Ambari and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-17491
> https://issues.apache.org/jira/browse/AMBARI-17491
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> Stack advisor recommeds to update host in Hive/Oozie db connection url when 
> we don't need that.
> 
> 
> Diffs
> -
> 
>   ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py 
> 3d6ca4c 
>   ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py 
> abea76e 
> 
> Diff: https://reviews.apache.org/r/49557/diff/
> 
> 
> Testing
> ---
> 
> mvn clean test
> 
> 
> Thanks,
> 
> Vitalyi Brodetskyi
> 
>



Re: Review Request 49557: Hive Database URL config updated by Ambari stack advisor recommendation

2016-07-02 Thread Vitalyi Brodetskyi

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

(Updated Липень 2, 2016, 5:39 після полудня)


Review request for Ambari and Sumit Mohanty.


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


Repository: ambari


Description
---

Stack advisor recommeds to update host in Hive/Oozie db connection url when we 
don't need that.


Diffs (updated)
-

  ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py 
3d6ca4c 
  ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py abea76e 

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


Testing
---

mvn clean test


Thanks,

Vitalyi Brodetskyi



Re: Review Request 49557: Hive Database URL config updated by Ambari stack advisor recommendation

2016-07-02 Thread Sumit Mohanty

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




ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py (line 
99)


Lets split it for readability
enclose the whole logic under "if hiveServerHost is not None"

Why does schema name matter?

Do we need to read oldDBType - if its not set would 
firstPartofDBConnectionURL be non None?



ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py (line 
193)


Rename it to getProtocol?



ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py (line 210)


Can we add one test with the value changed by stack advisor?


- Sumit Mohanty


On July 2, 2016, 4:29 p.m., Vitalyi Brodetskyi wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49557/
> ---
> 
> (Updated July 2, 2016, 4:29 p.m.)
> 
> 
> Review request for Ambari and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-17491
> https://issues.apache.org/jira/browse/AMBARI-17491
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> Stack advisor recommeds to update host in Hive/Oozie db connection url when 
> we don't need that.
> 
> 
> Diffs
> -
> 
>   ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py 
> 3d6ca4c 
>   ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py 
> abea76e 
> 
> Diff: https://reviews.apache.org/r/49557/diff/
> 
> 
> Testing
> ---
> 
> mvn clean test
> 
> 
> Thanks,
> 
> Vitalyi Brodetskyi
> 
>



Review Request 49557: Hive Database URL config updated by Ambari stack advisor recommendation

2016-07-02 Thread Vitalyi Brodetskyi

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

Review request for Ambari and Sumit Mohanty.


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


Repository: ambari


Description
---

Stack advisor recommeds to update host in Hive/Oozie db connection url when we 
don't need that.


Diffs
-

  ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py 
3d6ca4c 
  ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py abea76e 

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


Testing
---

mvn clean test


Thanks,

Vitalyi Brodetskyi