> On March 10, 2014, 10:09 p.m., Tom Beerbower wrote: > > Quick question. It's not clear to me where the issue was and what the fix > > is. Could you summarize the fix? > >
1. clusters.getHostsForCluster() was called inside the loop, essentially for every HostComponent and result in several lock acquisitions. (MaintenanceStateHelper.getEffectiveState(Sch) was the callee). 2. sc.getHostComponent(hostname) calls which also needed locking calls, were reduced with one call to get Map and do a lookup on it. 3. HostImpl.getHostName() again unnecessary locking here. 4. MantenanceStateHelper.getEffectiveState() was overloaded to wrok with the above changes. - Sid ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/18981/#review36714 ----------------------------------------------------------- On March 10, 2014, 8:54 p.m., Sid Wagle wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/18981/ > ----------------------------------------------------------- > > (Updated March 10, 2014, 8:54 p.m.) > > > Review request for Ambari, Sumit Mohanty and Tom Beerbower. > > > Bugs: AMBARI-5005 > https://issues.apache.org/jira/browse/AMBARI-5005 > > > Repository: ambari > > > Description > ------- > > [root@perf800-large1 ~]# time curl -u admin:admin > 'http://<server-ip>:8080/api/v1/clusters/c1/hosts?fields=Hosts/host_status,Hosts/maintenance_state,host_components/HostRoles/state,host_components/HostRoles/maintenance_state,alerts/summary&minimal_response=true&_=1393982657484' > > /dev/null > % Total % Received % Xferd Average Speed Time Time Time > Current > Dload Upload Total Spent Left Speed > 100 739k 0 739k 0 0 40120 0 --:--:-- 0:00:18 --:--:-- 191k > > real 0m18.878s > user 0m0.020s > sys 0m0.000s > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java > b0258a4 > > ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java > 69b58f7 > > ambari-server/src/main/java/org/apache/ambari/server/controller/MaintenanceStateHelper.java > 2b30b9f > > ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java > 9226cf1 > > ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java > 24e5b1a > > ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java > d151e8b > > ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java > c99bfa1 > > ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java > 3c1632c > > ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java > 2cc1165 > > ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java > 049af58 > > Diff: https://reviews.apache.org/r/18981/diff/ > > > Testing > ------- > > Results : > > Tests run: 1480, Failures: 0, Errors: 0, Skipped: 9 > > > Thanks, > > Sid Wagle > >
