IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27632


Ignore:
Timestamp:
Apr 7, 2010, 11:07:45 AM (16 years ago)
Author:
Paul Price
Message:

Adding destreak.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/errors.pl

    r27574 r27632  
    4646
    4747my $sql;                        # Query to run
    48 my $table;                      # Table with fault
     48my $fault_table;                # Table with fault
     49my $label_table;                # Table with label
    4950if ($stage eq "diff") {
    5051    $sql = "SELECT diff_id, skycell_id, hostname, path_base FROM diffRun JOIN diffSkyfile USING(diff_id) WHERE fault != 0";
    51     $table = "diffSkyfile";
     52    $label_table = "diffRun";
     53    $fault_table = "diffSkyfile";
    5254} elsif ($stage eq "stack") {
    5355    $sql = "SELECT stack_id, 'stack', hostname, path_base FROM stackRun JOIN stackSumSkyfile USING(stack_id) WHERE fault != 0";
    54     $table = "stackSumSkyfile";
     56    $label_table = "stackRun";
     57    $fault_table = "stackSumSkyfile";
    5558} elsif ($stage eq "warp") {
    5659    $sql = "SELECT warp_id, skycell_id, hostname, path_base FROM warpRun JOIN warpSkyfile USING(warp_id) WHERE fault != 0";
    57     $table = "warpSkyfile";
     60    $label_table = "warpRun";
     61    $fault_table = "warpSkyfile";
    5862} elsif ($stage eq "magic") {
    5963    $sql = "SELECT magic_id, node, 'unknown' AS hostname, CONCAT(workdir, '/', exp_id, '/', exp_id, '.mgc.', magic_id, '.', node) FROM magicRun JOIN magicNodeResult USING(magic_id) WHERE magicNodeResult.fault != 0";
    60     $table = "magicNodeResult";
     64    $label_table = "magicRun";
     65    $fault_table = "magicNodeResult";
    6166} elsif ($stage eq "chip") {
    6267    $sql = "SELECT chip_id, class_id, hostname, CONCAT(path_base, '.', class_id) FROM chipRun JOIN chipProcessedImfile USING(chip_id) WHERE fault != 0";
    63     $table = "chipProcessedImfile";
     68    $label_table = "chipRun";
     69    $fault_table = "chipProcessedImfile";
    6470} elsif ($stage eq "camera") {
    6571    $sql = "SELECT cam_id, 'cam', hostname, path_base FROM camRun JOIN camProcessedExp USING(cam_id) WHERE fault != 0";
    66     $table = "camProcessedExp";
     72    $label_table = "camRun";
     73    $fault_table = "camProcessedExp";
     74} elsif ($stage eq "destreak") {
     75    $sql = "SELECT magic_ds_id, component, 'unknown', CONCAT_WS('.', CONCAT(outroot, '/', exp_id), 'mds', magic_ds_id, stage_id, component) FROM magicDSRun JOIN magicDSFile USING(magic_ds_id) JOIN magicRun USING(magic_id) WHERE magicDSFile.fault != 0";
     76    $label_table = "magicDSRun";
     77    $fault_table = "magicDSFile";
    6778} else {
    6879    die "Unsupported stage: $stage\n";
     
    7081
    7182my $where = "";                 # WHERE restriction
    72 $where .= " AND (label LIKE '" . join("' OR label LIKE '", @$label) . "')" if defined $label;
    73 $where .= " AND $table.fault = $fault" if defined $fault;
     83$where .= " AND ($label_table.label LIKE '" . join("' OR $label_table.label LIKE '", @$label) . "')" if defined $label;
     84$where .= " AND $fault_table.fault = $fault" if defined $fault;
    7485
    7586$sql .= $where if length $where > 0;
Note: See TracChangeset for help on using the changeset viewer.