ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Hurley <jhur...@hortonworks.com>
Subject Re: Review Request 43621: Decrease the load on ambari database after cluster creation
Date Wed, 17 Feb 2016 15:17:23 GMT

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




ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java (line
108)
<https://reviews.apache.org/r/43621/#comment180828>

    I'm curious. One of the ways that we can easily remove a lot of the caching and nested
querying is to actually store the status of stages and requests in the database. I don't know
why we don't do this today. Attempting to find statuses of stages and requests by HRC leads
to all of these problems. Why not just use events from HRCs to store the correct data for
its stage and request in the DB and query it directly?



ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql (line 656)
<https://reviews.apache.org/r/43621/#comment180827>

    When adding new indexes, it's good practice to also decorate the JPA entities with the
indexes as well. This keeps our entities consitent with what's in our SQL files. Also keeps
things consistent for tests.


- Jonathan Hurley


On Feb. 17, 2016, 9:32 a.m., Sebastian Toader wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43621/
> -----------------------------------------------------------
> 
> (Updated Feb. 17, 2016, 9:32 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Myroslav Papirkovskyy, Sumit Mohanty, and
Sid Wagle.
> 
> 
> Bugs: AMBARI-15011
>     https://issues.apache.org/jira/browse/AMBARI-15011
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> 1. Created new index on host_role_command table on (status, role) fields as this table
is being queries quite often by status and role
> 2. Removed uneccessary querying of ambari server actions by hostname
> 3. Cache HostRoleCommandStatusSummaryDTO computed objects using guava cache
> 4. The method returning service configs made one call to the database to get the active
service config entities. Then retrieved from database all service config entities and while
building the response it was using the first collection to determine which reponse item should
be marked as active/inactive. This has been modified to make only one roundtrip to the database
and determine the active flag using plain java code.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
91f2d30 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
d2fe4fc 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
bd5fb5a 
>   ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerActionExecutor.java
20cf5bb 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
d3fdc65 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog222.java
88b3151 
>   ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql eded221 
>   ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql 780e81a 
>   ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql d4a1ddb 
>   ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql 64f2a4e 
>   ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql c557cf6 
>   ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql adda30c 
>   ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
bc4d397 
>   ambari-server/src/test/java/org/apache/ambari/server/agent/AgentResourceTest.java 510e1fb

>   ambari-server/src/test/java/org/apache/ambari/server/configuration/ConfigurationTest.java
1f90813 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
862776f 
>   ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java 0cdf50a

>   ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog222Test.java
aa4090e 
>   ambari-server/src/test/java/org/apache/ambari/server/utils/StageUtilsTest.java 2d663d9

> 
> Diff: https://reviews.apache.org/r/43621/diff/
> 
> 
> Testing
> -------
> 
> Manual testing:
> 
> Created a cluster of 3 nodes waited 30 mins with UI running and collected postgres sql
statement stats, than left the cluster running for another 30 mins wiht UI closed and getting
new sql statement stats. Verified that the number of execution of  queries mentioned in the
JIRA has decreased.
> 
> Unit tests:
> 
> Total run:884
> Total errors:0
> Total failures:0
> OK
> 
> 
> Thanks,
> 
> Sebastian Toader
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message