IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 11, 2011, 4:42:29 PM (15 years ago)
Author:
watersc1
Message:

Caught up with the trunk. Now to look for bugs.

Location:
branches/czw_branch/20101203
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20101203

  • branches/czw_branch/20101203/ippTools/share/chiptool_processedimfile.sql

    r29199 r30587  
    2929    rawImfile.magicked AS raw_magicked,
    3030    rawImfile.burntool_state,
    31     magicDSRun.state AS dsRun_state,
    32     IFNULL(magicDSRun.magic_ds_id, 0) AS magic_ds_id
     31    IFNULL(magicDSRun.magic_ds_id, 0) AS magic_ds_id,
     32    IFNULL(magicDSRun.state,0) AS dsRun_state,
     33    IFNULL(magicDSFile.fault,0) AS dsFile_fault,
     34    IFNULL(magicDSFile.data_state,0) AS dsFile_data_state
    3335FROM chipRun
    3436JOIN chipImfile
     
    4345LEFT JOIN magicDSRun
    4446    ON stage_id = chip_id AND stage = 'chip' AND magicDSRun.re_place AND magicDSRun.state != 'drop'
     47LEFT JOIN magicDSFile ON magicDSRun.magic_ds_id = magicDSFile.magic_ds_id AND chipProcessedImfile.class_id = magicDSFile.component
  • branches/czw_branch/20101203/ippTools/share/difftool_pendingcleanupskyfile.sql

    r24186 r30587  
    99    USING(diff_id)
    1010WHERE
    11    ((diffRun.state = 'goto_cleaned'  AND diffSkyfile.data_state = 'full')
     11   ((diffRun.state = 'goto_cleaned'  AND (diffSkyfile.data_state = 'full' OR diffSkyfile.data_state = 'update'))
    1212    OR
    1313    (diffRun.state = 'goto_scrubbed' AND diffSkyfile.data_state != 'scrubbed')
  • branches/czw_branch/20101203/ippTools/share/difftool_setskyfiletoupdate.sql

    r29568 r30587  
    11UPDATE diffRun
    22    JOIN diffSkyfile USING(diff_id)
    3     LEFT JOIN magicDSRun ON (stage_id = diff_id AND stage = 'diff')
    4     LEFT JOIN magicDSFile ON (magicDSRun.magic_ds_id = magicDSFile.magic_ds_id
    5                               AND component = skycell_id)
    63SET diffRun.state = 'update',
    7     diffSkyfile.data_state = 'update'
     4    diffSkyfile.data_state = 'update',
     5    diffSkyfile.fault = 0
    86    -- set hook %s
    97WHERE diff_id = %lld
    108    AND (diffRun.state = 'cleaned' OR diffRun.state = 'update')
    11     AND (diffSkyfile.data_state = 'cleaned')
     9    AND (diffSkyfile.data_state = 'cleaned' OR diffSkyfile.data_state = 'update')
  • branches/czw_branch/20101203/ippTools/share/magicdstool_setfiletoupdate.sql

    r29561 r30587  
    77WHERE magic_ds_id = %lld
    88    AND (magicDSRun.state = 'cleaned' OR magicDSRun.state = 'update')
    9     AND (magicDSFile.data_state = 'cleaned')
     9    AND (magicDSFile.data_state = 'cleaned' OR magicDSFile.data_state ='update')
  • branches/czw_branch/20101203/ippTools/share/warptool_change_skyfile_data_state.sql

    r26567 r30587  
    11-- handle changes in warpSkyfile.data_state.
    22-- Used for the modes tofullskyfile, tocleanedskyfile and topurgedskyfile
    3 -- args are new data_state, string for magic hook, warp_id, skycell_id and current expected state for warpRun
     3-- arguments are are new data_state, string for magic hook, warp_id, skycell_id
    44UPDATE warpSkyfile
    55JOIN warpRun USING(warp_id)
  • branches/czw_branch/20101203/ippTools/share/warptool_scmap.sql

    r29349 r30587  
    1212    IFNULL(magicDSRun.magic_ds_id, 0) AS magic_ds_id,
    1313    IFNULL(magicDSRun.state, 0) AS dsRun_state,
     14    IFNULL(magicDSFile.data_state, 0) AS dsFile_data_state,
    1415    IFNULL(magicDSFile.fault, 0) as dsFile_fault
    1516FROM warpRun
  • branches/czw_branch/20101203/ippTools/share/warptool_setskyfiletoupdate.sql

    r29568 r30587  
    11UPDATE warpRun
    22    JOIN warpSkyfile USING(warp_id)
    3     LEFT JOIN magicDSRun ON (stage_id = warp_id AND stage = 'warp')
    4     LEFT JOIN magicDSFile ON (magicDSRun.magic_ds_id = magicDSFile.magic_ds_id
    5                               AND component = skycell_id)
    63SET warpRun.state = 'update',
    7     warpSkyfile.data_state = 'update'
     4    warpSkyfile.data_state = 'update',
     5    warpSkyfile.fault = 0
    86    -- set hook %s
    97WHERE warp_id = %lld
    108    AND (warpRun.state = 'cleaned' OR warpRun.state = 'update')
    11     AND (warpSkyfile.data_state = 'cleaned')
     9    AND (warpSkyfile.data_state = 'cleaned' OR warpSkyfile.data_state = 'update')
  • branches/czw_branch/20101203/ippTools/share/warptool_towarped.sql

    r29171 r30587  
    1111    exp_tag,
    1212    workdir,
     13    label,
    1314    magicked,
    1415    path_base,
     
    2324        warpRun.state,
    2425        warpRun.reduction,
     26        warpRun.label,
    2527        camRun.cam_id,
    2628        rawExp.camera,
     
    7678        warpRun.state,
    7779        warpRun.reduction,
     80        warpRun.label,
    7881        camRun.cam_id,
    7982        rawExp.camera,
  • branches/czw_branch/20101203/ippTools/src/chiptool.c

    r29982 r30587  
    838838    PXOPT_COPY_S16(config->args, where, "-fault", "chipProcessedImfile.fault", "==");
    839839
     840    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
     841
    840842    if (!psListLength(where->list)
    841843        && !psMetadataLookupBool(NULL, config->args, "-all")) {
     
    874876    }
    875877    psFree(query);
     878
     879    if (!fault) {
     880        // If fault has not been supplied, don't revert update faults with the magic value
     881        // We don't do this for new runs because then they would never complete
     882        // quality should be used to drop bad components
     883        psStringAppend(&query_update, " AND (chipProcessedImfile.fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT);
     884    }
    876885    if (!p_psDBRunQuery(config->dbh, query_update)) {
    877886        psError(PS_ERR_UNKNOWN, false, "database error");
     
    19191928    }
    19201929
     1930    // we do not update components with the magic fault value. They are non-updateable
     1931    psStringAppend(&query, " AND (chipProcessedImfile.fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT);
     1932
    19211933    if (!p_psDBRunQueryF(config->dbh, query, setHook, chip_id)) {
    19221934        psError(PS_ERR_UNKNOWN, false, "database error");
  • branches/czw_branch/20101203/ippTools/src/difftool.c

    r30118 r30587  
    917917    PXOPT_COPY_S16(config->args, where, "-fault",     "fault", "==");
    918918
     919    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
     920
    919921    if (!psListLength(where->list) && !psMetadataLookupBool(NULL, config->args, "-all")) {
    920922        psFree(where);
     
    950952        psLogMsg("difftool", PS_LOG_INFO, "Deleted %" PRIu64 " rows", psDBAffectedRows(config->dbh));
    951953
     954        if (!fault) {
     955            // If fault has not been supplied, don't revert update faults with the magic value
     956            // We don't do this for new runs because then they would never complete
     957            // quality should be used to drop bad components
     958            psStringAppend(&query_updated, " AND (diffSkyfile.fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT);
     959        }
    952960        if (!p_psDBRunQuery(config->dbh, query_updated)) {
    953961            psError(PS_ERR_UNKNOWN, false, "database error");
     
    31983206        psStringAppend(&query, " AND (diffSkyfile.skycell_id = '%s')", skycell_id);
    31993207    }
     3208    // we do not update components with the magic fault value. They are non-updateable
     3209    // (But can be recovered with "difftool -revertwarped -fault 26" (PXTOOL_DO_NOT_REVERT_FAULT)
     3210    psStringAppend(&query, " AND (diffSkyfile.fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT);
    32003211
    32013212    if (!p_psDBRunQueryF(config->dbh, query, setHook, diff_id)) {
  • branches/czw_branch/20101203/ippTools/src/disttool.c

    r30586 r30587  
    11851185    PXOPT_COPY_S64(config->args, where, "-stage_id", "stage_id", "==");
    11861186    PXOPT_COPY_STR(config->args, where, "-state", "state", "==");
    1187     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     1187    pxAddLabelSearchArgs(config, where, "-label", "label", "==");
    11881188    PXOPT_COPY_S16(config->args, where, "-fault", "rcDSFileset.fault", "==");
    11891189
  • branches/czw_branch/20101203/ippTools/src/disttoolConfig.c

    r29067 r30587  
    197197    psMetadataAddS64(revertfilesetArgs, PS_LIST_TAIL, "-stage_id",0, "define stage_id", 0);
    198198    psMetadataAddStr(revertfilesetArgs, PS_LIST_TAIL, "-state",   0, "define state", NULL);
    199     psMetadataAddStr(revertfilesetArgs, PS_LIST_TAIL, "-label",   0, "define label", NULL);
     199    psMetadataAddStr(revertfilesetArgs, PS_LIST_TAIL, "-label",   PS_META_DUPLICATE_OK, "define label", NULL);
    200200    psMetadataAddS16(revertfilesetArgs, PS_LIST_TAIL, "-fault",   0, "define fault code", 0);
    201201    psMetadataAddBool(revertfilesetArgs, PS_LIST_TAIL, "-all",    0, "revert all faulted runs", NULL);
  • branches/czw_branch/20101203/ippTools/src/magicdstool.c

    r30586 r30587  
    11121112
    11131113    PXOPT_LOOKUP_STR(state, config->args, "-state", false, false);
     1114    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
    11141115
    11151116    psString queryFile = NULL;
     1117    bool stateIsUpdate = false;
    11161118    if (state) {
    11171119        if (! strcmp(state, "new") || !strcmp(state, "goto_restored")) {
     
    11191121        } else if (!strcmp(state, "update")) {
    11201122            queryFile = "magicdstool_revertupdated.sql";
     1123            stateIsUpdate = true;
    11211124        } else {
    11221125            psError(PXTOOLS_ERR_SYS, true, "%s is not a valid value for state", state);
     
    11411144    }
    11421145    psFree(where);
     1146
     1147    if (stateIsUpdate && !fault) {
     1148        // If fault has not been supplied, don't revert update faults with
     1149        // the magic "do not update" value
     1150        // We don't do this for new runs because then they would never complete
     1151        // quality should be used to drop bad components
     1152        psStringAppend(&query, " AND magicDSFile.fault != %d", PXTOOL_DO_NOT_REVERT_FAULT);
     1153    }
    11431154
    11441155    if (!p_psDBRunQuery(config->dbh, query)) {
     
    17441755    }
    17451756
     1757    // we do not update components with the magic fault value. They are non-updateable
     1758    // (But can be recovered with "magicdstool -revertdestreakedfile -fault 26" (PXTOOL_DO_NOT_REVERT_FAULT)
     1759    psStringAppend(&query, " AND (magicDSFile.fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT);
     1760
    17461761    if (!p_psDBRunQueryF(config->dbh, query, setHook, magic_ds_id)) {
    17471762        psError(PS_ERR_UNKNOWN, false, "database error");
  • branches/czw_branch/20101203/ippTools/src/magictool.c

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/czw_branch/20101203/ippTools/src/pstamptool.c

    r30586 r30587  
    571571    PXOPT_COPY_S32(config->args, where, "-fault",      "fault", "==");
    572572    PXOPT_COPY_STR(config->args, where, "-state",      "state", "==");
     573    PXOPT_COPY_STR(config->args, where, "-reqType",     "reqType", "==");
     574    PXOPT_COPY_STR(config->args, where, "-name",     "name", "LIKE");
    573575    PXOPT_COPY_TIME(config->args, where, "-timestamp_begin", "timestamp", ">=");
    574576    PXOPT_COPY_TIME(config->args, where, "-timestamp_end", "timestamp", "<=");
     
    586588        psStringAppend(&query, ", state = '%s'", state);
    587589        if (!strcmp(state, "goto_cleaned")) {
    588             psStringAppend(&stateCheck, " AND state != 'cleaned'");
     590            psStringAppend(&stateCheck, " AND (state != 'cleaned' AND state != 'goto_cleaned')");
    589591        }
    590592    }
  • branches/czw_branch/20101203/ippTools/src/pstamptoolConfig.c

    r30586 r30587  
    104104    psMetadataAddS16(updatereqArgs, PS_LIST_TAIL, "-fault", 0,        "search by fault code", 0);
    105105    psMetadataAddStr(updatereqArgs, PS_LIST_TAIL, "-state", 0,        "search by state", NULL);
     106    psMetadataAddStr(updatereqArgs, PS_LIST_TAIL, "-reqType", 0,      "search by reqType", NULL);
     107    psMetadataAddStr(updatereqArgs, PS_LIST_TAIL, "-name", 0,      "search by reqType (LIKE comparsion)", NULL);
    106108    psMetadataAddStr(updatereqArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by pstampJob label (LIKE comparision)", NULL);
    107109    psMetadataAddTime(updatereqArgs, PS_LIST_TAIL, "-timestamp_begin", 0, "search by timestamp (>=)", NULL);
  • branches/czw_branch/20101203/ippTools/src/pxtools.h

    r28486 r30587  
    5151# define MAX_ROWS 10e9
    5252# define PXTOOL_MODE_NONE 0x0
     53// we do not revert or update components with this fault value
     54// This is the same value as PSTAMP_GONE
     55# define PXTOOL_DO_NOT_REVERT_FAULT 26
    5356
    5457bool pxIsValidState(const char *state);
  • branches/czw_branch/20101203/ippTools/src/regtool.c

    r30586 r30587  
    211211  // convert regular class_id format to summitImfile.class_id format
    212212  rep = psStringCopy(class_id);
    213   psFree(class_id);
     213
    214214  class_id = rep;
    215215 
     
    320320  psStringSubstitute(&query,dateobs_end,"@DATEOBS_END@");
    321321
    322   // fprintf(stderr,"%s",query);
     322  fprintf(stderr,"%s",query);
    323323
    324324  if (!p_psDBRunQuery(config->dbh, query)) {
     
    345345  }
    346346
    347   // fprintf (stderr, "found %ld rows\n", output->n);
     347  fprintf (stderr, "found %ld rows\n", output->n);
    348348  if (!psArrayLength(output)) {
    349349    psTrace("regtool", PS_LOG_INFO, "no rows found");
     
    370370    char *tmp_id = psMetadataLookupStr(&status,row,"summit_class_id");
    371371    if (!status) {
    372       //      fprintf (stderr, "incomplete on %s\n", psMetadataLookupStr(NULL,row,"exp_name"));
     372            fprintf (stderr, "incomplete on %s\n", psMetadataLookupStr(NULL,row,"exp_name"));
    373373        continue;
    374374    }
     
    440440        already_burned = false;
    441441
    442         //      fprintf (stderr, "missing uri: %s %s\n", psMetadataLookupStr(NULL,row,"exp_name"), this_class_id);
     442        fprintf (stderr, "missing uri: %s %s\n", psMetadataLookupStr(NULL,row,"exp_name"), this_class_id);
    443443
    444444        // Save this round for next round.
     
    19031903  psFree(query);
    19041904  query = rep;
    1905   psStringSubstitute(&class_id,"ota","XY");
    19061905  psStringSubstitute(&query,class_id,"@CLASS_ID@");
    1907    
     1906  psStringSubstitute(&query,"ota","XY");
     1907 
    19081908  if (!date) {
    19091909    if (!dateobs_begin || !dateobs_end) {
  • branches/czw_branch/20101203/ippTools/src/warptool.c

    r29903 r30587  
    14851485    PXOPT_COPY_S16(config->args, where, "-fault",      "warpSkyfile.fault", "==");
    14861486
     1487    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
     1488
    14871489    if (!psListLength(where->list)
    14881490        && !psMetadataLookupBool(NULL, config->args, "-all")) {
     
    15101512    }
    15111513    psFree(where);
     1514
     1515    if (!fault) {
     1516        // If fault has not been supplied, don't revert update faults with the magic value
     1517        // We don't do this for new runs because then they would never complete
     1518        // quality should be used to drop bad components
     1519        psStringAppend(&query_updated, " AND warpSkyfile.fault != %d", PXTOOL_DO_NOT_REVERT_FAULT);
     1520    }
    15121521
    15131522    if (!p_psDBRunQuery(config->dbh, query)) {
     
    20032012// shared code for the modes -tocleanedskyfile -tofullskyfile -topurgedskyfile
    20042013
    2005 static bool change_skyfile_data_state(pxConfig *config, psString data_state, psString run_state)
     2014static bool change_skyfile_data_state(pxConfig *config, psString data_state)
    20062015{
    20072016    PS_ASSERT_PTR_NON_NULL(config, false);
     
    20652074static bool tocleanedskyfileMode(pxConfig *config)
    20662075{
    2067     return change_skyfile_data_state(config, "cleaned", "goto_cleaned");
     2076    return change_skyfile_data_state(config, "cleaned");
    20682077}
    20692078static bool tofullskyfileMode(pxConfig *config)
    20702079{
    2071     return change_skyfile_data_state(config, "full", "update");
     2080    return change_skyfile_data_state(config, "full");
    20722081}
    20732082static bool topurgedskyfileMode(pxConfig *config)
    20742083{
    2075     return change_skyfile_data_state(config, "purged", "goto_purged");
     2084    return change_skyfile_data_state(config, "purged");
    20762085}
    20772086static bool toscrubbedskyfileMode(pxConfig *config)
    20782087{
    2079      return change_skyfile_data_state(config, "scrubbed", "goto_scrubbed");
     2088     return change_skyfile_data_state(config, "scrubbed");
    20802089}
    20812090
     
    21012110    else {
    21022111      if (strcmp(state,"error_cleaned") == 0) {
    2103         change_skyfile_data_state(config,"error_cleaned","goto_cleaned");
     2112        change_skyfile_data_state(config,"error_cleaned");
    21042113      }
    21052114      else if (strcmp(state, "error_scrubbed") == 0) {
    2106         change_skyfile_data_state(config,"error_scrubbed","goto_scrubbed");
     2115        change_skyfile_data_state(config,"error_scrubbed");
    21072116      }
    21082117      else if (strcmp(state, "error_purged") == 0) {
    2109         change_skyfile_data_state(config,"error_purged","goto_purged");
     2118        change_skyfile_data_state(config,"error_purged");
    21102119      }
    21112120      else {
     
    25262535        psStringAppend(&query, " AND (warpSkyfile.skycell_id = '%s')", skycell_id);
    25272536    }
     2537    // we do not update components with the magic fault value. They are non-updateable
     2538    // (But can be recovered with "warptool -revertwarped -fault 26" (PXTOOL_DO_NOT_REVERT_FAULT)
     2539    psStringAppend(&query, " AND (warpSkyfile.fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT);
    25282540
    25292541    if (!p_psDBRunQueryF(config->dbh, query, setHook, warp_id)) {
Note: See TracChangeset for help on using the changeset viewer.