Changeset 31808
- Timestamp:
- Jul 1, 2011, 8:49:25 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/ipptopspsdb.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/ipptopspsdb.py
r31503 r31808 23 23 Creates a new batch 24 24 ''' 25 def createNewBatch(self, batchType, s urvey, dvoDb, datastoreProduct):25 def createNewBatch(self, batchType, stageID, survey, dvoDb, datastoreProduct): 26 26 27 27 sql = "INSERT INTO batch ( \ 28 28 batch_type, \ 29 stage_id, \ 29 30 survey, \ 30 31 dvo_db, \ … … 32 33 ) VALUES ( \ 33 34 '" + batchType + "', \ 35 " + str(stageID) + ", \ 34 36 '" + survey + "', \ 35 37 '" + dvoDb + "', \ … … 91 93 Have we already processed and published this batch? 92 94 ''' 93 def alreadyProcessed(self, table, col, value):95 def alreadyProcessed(self, stage_id): 94 96 95 sql = "SELECT COUNT(*) FROM \ 96 " + table + " \ 97 JOIN batch USING(batch_id) \ 98 WHERE " + col + " = " + str(value) + " \ 97 sql = "SELECT COUNT(*) \ 98 FROM batch \ 99 WHERE stage_id = " + str(stage_id) + " \ 99 100 AND processed \ 100 101 AND loaded_to_datastore" … … 104 105 rs.first() 105 106 if rs.getInt(1) > 0: 106 self.logger.error("Batch with "+col+" = "+str(value)+" has already been processed and published to datastore")107 self.logger.error("Batch with stage_id = "+str(stage_id) + " has already been processed and published to datastore") 107 108 return True 108 109 else: … … 133 134 Inserts some stack metadata for this batch ID 134 135 ''' 135 def insertStackMeta(self, batchID, s kyID, stackID, filter, stackType):136 def insertStackMeta(self, batchID, stackID, filter, stackType): 136 137 137 138 sql = "INSERT INTO stack ( \ 138 139 batch_id \ 139 ,sky_id \140 140 ,stack_id \ 141 141 ,filter \ … … 143 143 ) VALUES ( \ 144 144 " + str(batchID) + " \ 145 ," + str(skyID) + " \146 145 ," + str(stackID) + " \ 147 146 ,'" + filter + "' \
Note:
See TracChangeset
for help on using the changeset viewer.
