IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32209


Ignore:
Timestamp:
Aug 29, 2011, 9:29:02 AM (15 years ago)
Author:
rhenders
Message:

setter methods for new 'deleted' columns; getters for batches not deleted from either local disk, datastore or dxlayer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/ipptopspsdb.py

    r32193 r32209  
    5959    Returns a list of processed batch IDs that are merged but not yet deleted
    6060    '''
    61     def getMergedButNotDeletedBatchIDs(self, batchType, epoch, dvoGpc1Label):
     61    def getMergedButNotDeletedBatchIDs(self, batchType, epoch, dvoGpc1Label, column):
    6262
    6363        sql = "SELECT DISTINCT batch_id \
     
    6767               AND dvo_db = '" + dvoGpc1Label + "' \
    6868               AND merged = 1\
    69                AND deleted = 0"
     69               AND " + column + " = 0"
    7070
    7171        ids = []
     
    8484
    8585    '''
     86    Returns a list of processed batch IDs that are merged but not deleted from local disk
     87    '''
     88    def getMergedButNotDeletedFromLocalDisk(self, batchType, epoch, dvoGpc1Label):
     89        return self.getMergedButNotDeletedBatchIDs(batchType, epoch, dvoGpc1Label, "deleted_local")
     90
     91    '''
     92    Returns a list of processed batch IDs that are merged but not deleted from datastore
     93    '''
     94    def getMergedButNotDeletedFromDatastore(self, batchType, epoch, dvoGpc1Label):
     95        return self.getMergedButNotDeletedBatchIDs(batchType, epoch, dvoGpc1Label, "deleted_datastore")
     96
     97    '''
     98    Returns a list of processed batch IDs that are merged but not deleted from DXLayer
     99    '''
     100    def getMergedButNotDeletedFromDXLayer(self, batchType, epoch, dvoGpc1Label):
     101        return self.getMergedButNotDeletedBatchIDs(batchType, epoch, dvoGpc1Label, "deleted_dxlayer")
     102
     103
     104    '''
    86105    Returns a list of processed batch IDs that are not loaded to the datastore
    87106    '''
    88     def getProcessedButFailedDatastoreBatchIDs(self, epoch, dvoGpc1Label):
     107    def getProcessedButFailedDatastoreBatchIDs(self, epoch, dvoGpc1Label, batchType):
    89108
    90109        sql = "SELECT DISTINCT batch_id \
    91110               FROM batch \
    92111               WHERE timestamp > '" + epoch + "' \
     112               AND batch_type = '" + batchType + "' \
    93113               AND dvo_db = '" + dvoGpc1Label + "' \
    94114               AND processed = 1\
     
    292312
    293313    '''
    294     Updates batch deleted field
    295     '''
    296     def updateDeleted(self, batchID, deleted):
    297         self.updateColumn(batchID, "deleted", deleted)
     314    Updates batch deleted local field
     315    '''
     316    def updateDeletedLocal(self, batchID, value):
     317        self.updateColumn(batchID, "deleted_local", value)
     318
     319    '''
     320    Updates batch deleted datastore field
     321    '''
     322    def updateDeletedDatastore(self, batchID, value):
     323        self.updateColumn(batchID, "deleted_datastore", value)
     324
     325    '''
     326    Updates batch deleted dxlayer field
     327    '''
     328    def updateDeletedDxlayer(self, batchID, value):
     329        self.updateColumn(batchID, "deleted_dxlayer", value)
    298330
    299331    '''
Note: See TracChangeset for help on using the changeset viewer.