IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 14, 2009, 11:06:18 AM (17 years ago)
Author:
bills
Message:

Add data_group, dist_group, and note to the pipeline. These new columns will be used
for some of the tasks that label was used previously.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/pxwarp.c

    r24487 r25835  
    2929#include "pxwarp.h"
    3030
    31 bool pxwarpRunSetState(pxConfig *config, psS64 warp_id, const char *state)
    32 {
    33     PS_ASSERT_PTR_NON_NULL(config, false);
    34     PS_ASSERT_PTR_NON_NULL(state, false);
    35 
    36     // check that state is a valid string value
    37     if (!pxIsValidState(state)) {
    38         psError(PS_ERR_UNKNOWN, false, "invalid warpRun state: %s", state);
    39         return false;
    40     }
    41 
    42     char *query = "UPDATE warpRun SET state = '%s' WHERE warp_id = %" PRId64;
    43     if (!p_psDBRunQueryF(config->dbh, query, state, warp_id)) {
    44         psError(PS_ERR_UNKNOWN, false,
    45                 "failed to change state for warp_id %" PRId64, warp_id);
    46         return false;
    47     }
    48 
    49     return true;
    50 }
    51 
    52 
    53 bool pxwarpRunSetStateByQuery(pxConfig *config, psMetadata *where, const char *state)
    54 {
    55     PS_ASSERT_PTR_NON_NULL(config, false);
    56     PS_ASSERT_PTR_NON_NULL(state, false);
    57 
    58     // check that state is a valid string value
    59     if (!pxIsValidState(state)) {
    60         psError(PS_ERR_UNKNOWN, false, "invalid warpRun state: %s", state);
    61         return false;
    62     }
    63 
    64     psString query = psStringCopy("UPDATE warpRun JOIN fakeRun USING(fake_id) JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) SET warpRun.state = '%s'");
    65 
    66     if (where) {
    67         psString whereClause = psDBGenerateWhereSQL(where, NULL);
    68         if (whereClause && strlen(whereClause) > 0) {
    69             psStringAppend(&query, " %s", whereClause);
    70         }
    71         psFree(whereClause);
    72     }
    73 
    74     if (!p_psDBRunQueryF(config->dbh, query, state)) {
    75         psFree(query);
    76         psError(PS_ERR_UNKNOWN, false, "database error");
    77         return false;
    78     }
    79 
    80     psFree(query);
    81 
    82     return true;
    83 }
    84 
    85 
    86 bool pxwarpRunSetLabel(pxConfig *config, psS64 warp_id, const char *label)
    87 {
    88     PS_ASSERT_PTR_NON_NULL(config, false);
    89     // note label == NULL should be explicitly allowed
    90 
    91     char *query = "UPDATE warpRun SET warpRun.label = '%s' WHERE warp_id = %" PRId64;
    92     if (!p_psDBRunQueryF(config->dbh, query, label, warp_id)) {
    93         psError(PS_ERR_UNKNOWN, false,
    94                 "failed to change label for warp_id %" PRId64, warp_id);
    95         return false;
    96     }
    97 
    98     return true;
    99 }
    100 
    101 
    102 bool pxwarpRunSetLabelByQuery(pxConfig *config, psMetadata *where, const char *label)
    103 {
    104     PS_ASSERT_PTR_NON_NULL(config, false);
    105     // note label == NULL should be explicitly allowed
    106 
    107     psString query = psStringCopy("UPDATE warpRun JOIN fakeRun USING(fake_id) JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) SET warpRun.label = '%s'");
    108 
    109     if (where) {
    110         psString whereClause = psDBGenerateWhereSQL(where, NULL);
    111         psStringAppend(&query, " %s", whereClause);
    112         psFree(whereClause);
    113     }
    114 
    115     if (!p_psDBRunQueryF(config->dbh, query, label)) {
    116         psFree(query);
    117         psError(PS_ERR_UNKNOWN, false, "database error");
    118         return false;
    119     }
    120 
    121     psFree(query);
    122 
    123     return true;
    124 }
    125 
    126 
    12731bool pxwarpQueueByFakeID(pxConfig *config,
    12832                         psS64 fake_id,
    12933                         const char *workdir,
    13034                         const char *label,
     35                         const char *data_group,
     36                         const char *dist_group,
    13137                         const char *dvodb,
    13238                         const char *tess_id,
    13339                         const char *reduction,
    134                          const char *end_stage)
     40                         const char *end_stage,
     41                         const char *note)
    13542{
    13643    PS_ASSERT_PTR_NON_NULL(config, false);
     
    14552        "dirty",    // workdir_state
    14653        label,
     54        data_group,
     55        dist_group,
    14756        dvodb,
    14857        tess_id,
    149                        reduction,
     58        reduction,
    15059        end_stage,
    15160        NULL,      // registered
    152         0          // magicked zero when created will get updated when warpRun goes to 'full'
     61        0,         // magicked set to zero when created may get updated when warpRun goes to 'full'
     62        NULL        // note
    15363    )) {
    15464        psError(PS_ERR_UNKNOWN, false, "database error");
Note: See TracChangeset for help on using the changeset viewer.