Updated Branches: refs/heads/branch-1.2.5 7cf113337 -> 0858f3a8a
AMBARI-2812. Ambari server leaks memory. (swagle) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/0858f3a8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/0858f3a8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/0858f3a8 Branch: refs/heads/branch-1.2.5 Commit: 0858f3a8ab119655266c2610fd86ff6ff65a1d5c Parents: 7cf1133 Author: Siddharth Wagle <[email protected]> Authored: Mon Aug 5 19:00:35 2013 -0700 Committer: Siddharth Wagle <[email protected]> Committed: Tue Aug 6 11:45:20 2013 -0700 ---------------------------------------------------------------------- .../org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0858f3a8/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java index a1a4c2f..5f36e45 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java @@ -44,7 +44,7 @@ public class HostRoleCommandDAO { DaoUtils daoUtils; private static Logger LOG = LoggerFactory.getLogger(HostRoleCommandDAO.class); private static final int REQUESTS_RESULT_LIMIT_WITH_FILTER = 20; - private static final int REQUESTS_RESULT_LIMIT = 200; + private static final int REQUESTS_RESULT_LIMIT = 100; @Transactional public HostRoleCommandEntity findByPK(long taskId) { @@ -66,6 +66,7 @@ public class HostRoleCommandDAO { "SELECT task FROM HostRoleCommandEntity task " + "WHERE task.requestId IN ?1 " + "ORDER BY task.taskId", HostRoleCommandEntity.class); + query.setMaxResults(REQUESTS_RESULT_LIMIT); return daoUtils.selectList(query, requestIds); } @@ -76,6 +77,7 @@ public class HostRoleCommandDAO { "WHERE task.requestId IN ?1 AND task.taskId IN ?2 " + "ORDER BY task.taskId", HostRoleCommandEntity.class ); + query.setMaxResults(REQUESTS_RESULT_LIMIT); return daoUtils.selectList(query, requestIds, taskIds); } @@ -180,6 +182,7 @@ public class HostRoleCommandDAO { queryStr.append("ORDER BY command.requestId DESC"); TypedQuery<Long> query = entityManagerProvider.get().createQuery(queryStr.toString(), Long.class); + query.setMaxResults(REQUESTS_RESULT_LIMIT); if (statuses != null && !statuses.isEmpty()) { results = daoUtils.selectList(query, statuses);
