> On Липень 2, 2016, 4:42 після полудня, Sumit Mohanty wrote:
> > ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py, line 
> > 210
> > <https://reviews.apache.org/r/49557/diff/1/?file=1435676#file1435676line210>
> >
> >     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
> > <https://reviews.apache.org/r/49557/diff/1/?file=1435675#file1435675line193>
> >
> >     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
> > <https://reviews.apache.org/r/49557/diff/1/?file=1435675#file1435675line99>
> >
> >     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
> 
>

Reply via email to