IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 19, 2012, 3:39:28 PM (14 years ago)
Author:
bills
Message:

Add support for pstampJobs that depend on other jobs. This will be used to implement
working dependency checking for detectability queries

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/share/pstamptool_pendingjob.sql

    r27856 r33119  
    1 SELECT pstampJob.*,
    2     IFNULL(Label.priority, 10000) AS priority
     1SELECT * FROM
     2(SELECT pstampJob.*,
     3    IFNULL(Label.priority, 10000) AS priority,
     4    0 AS myParent,
     5    0 AS runningChildren
    36FROM pstampJob
    47    JOIN pstampRequest USING(req_id)
     
    912    AND pstampJob.state = 'run'
    1013    AND pstampJob.fault = 0
     14    AND NOT is_parent
    1115    AND (dep_id = 0 OR pstampDependent.state = 'full')
    1216    AND (Label.active OR Label.active IS NULL)
     17    -- where hook 1 %s
     18UNION
     19SELECT * FROM
     20  (SELECT pstampJob.*,
     21        IFNULL(Label.priority, 10000) AS priority
     22    FROM pstampJob
     23        JOIN pstampRequest USING(req_id)
     24        LEFT JOIN pstampDependent USING(dep_id)
     25        LEFT JOIN Label ON pstampRequest.label = Label.label
     26    WHERE pstampRequest.state = 'run'
     27        AND pstampRequest.fault = 0
     28        AND pstampJob.state = 'run'
     29        AND pstampJob.fault = 0
     30        AND is_parent
     31        AND (dep_id = 0 OR pstampDependent.state = 'full')
     32        AND (Label.active OR Label.active IS NULL)
     33        -- where hook 2 %s
     34    ) as parentJob
     35    LEFT JOIN
     36    (SELECT parent_id AS myParent,
     37            count(job_id) as runningChildren
     38        FROM pstampRequest JOIN pstampJob USING(req_id)
     39        WHERE pstampRequest.state ='run'
     40            AND pstampJob.state = 'run'
     41            AND pstampJob.parent_id
     42        GROUP BY parent_id
     43    ) as childJobs
     44    ON childJobs.myParent = parentJob.job_id
     45    WHERE runningChildren IS NULL
     46) AS theQuery
     47
     48
Note: See TracChangeset for help on using the changeset viewer.