[rhmessaging-commits] rhmessaging commits: r3431 - mgmt/trunk/cumin/python/cumin/grid.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Jun 8 11:28:59 EDT 2009


Author: eallen
Date: 2009-06-08 11:28:59 -0400 (Mon, 08 Jun 2009)
New Revision: 3431

Modified:
   mgmt/trunk/cumin/python/cumin/grid/job.py
   mgmt/trunk/cumin/python/cumin/grid/job.strings
Log:
For the job query, restore the join on stats; but only when needed.

Modified: mgmt/trunk/cumin/python/cumin/grid/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/job.py	2009-06-08 14:47:22 UTC (rev 3430)
+++ mgmt/trunk/cumin/python/cumin/grid/job.py	2009-06-08 15:28:59 UTC (rev 3431)
@@ -93,6 +93,10 @@
         elems.append("s.pool = %(pool)s")
         return "where %s" % " and ".join(elems)
 
+    def render_stats_join(self, session, *args):
+        phase = self.phase.get(session)
+        return (phase == 'c') and "left outer join job_stats as c on c.id = j.stats_curr_id" or ""
+
     def get_sql_values(self, session, *args):
         pool = args[0]
         return {"pool": pool.id}

Modified: mgmt/trunk/cumin/python/cumin/grid/job.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/job.strings	2009-06-08 14:47:22 UTC (rev 3430)
+++ mgmt/trunk/cumin/python/cumin/grid/job.strings	2009-06-08 15:28:59 UTC (rev 3431)
@@ -17,6 +17,7 @@
   j.cmd,
   j.qmf_delete_time
 from job as j
+{stats_join}
 inner join scheduler as s on s.id = j.scheduler_id
 inner join submitter as b on b.id = j.submitter_id
 {sql_where}
@@ -34,6 +35,7 @@
 [JobSet.count_sql]
 select count(1)
 from job as j
+{stats_join}
 inner join scheduler as s on s.id = j.scheduler_id
 inner join submitter as b on b.id = j.submitter_id
 {sql_where}




More information about the rhmessaging-commits mailing list