Bläddra i källkod

AMBARI-2838. Running Requests are not visibile on the UI since the API is not returning the running requests. (smohanty)

Sumit Mohanty 12 år sedan
förälder
incheckning
1d21a41c8b

+ 2 - 5
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java

@@ -43,8 +43,7 @@ public class HostRoleCommandDAO {
   @Inject
   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 = 100;
+  private static final int REQUESTS_RESULT_LIMIT = 10;
 
   @Transactional
   public HostRoleCommandEntity findByPK(long taskId) {
@@ -66,7 +65,6 @@ 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);
   }
 
@@ -77,7 +75,6 @@ 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);
   }
 
@@ -107,7 +104,7 @@ public class HostRoleCommandDAO {
         "FROM HostRoleCommandEntity command ORDER BY command.requestId DESC";
     TypedQuery<Long> query = entityManagerProvider.get().createQuery(queryStr,
         Long.class);
-    query.setMaxResults(20);
+    query.setMaxResults(REQUESTS_RESULT_LIMIT);
     return daoUtils.selectList(query);
   }