Changeset 32541
- Timestamp:
- Oct 13, 2011, 9:50:28 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/ipptopspsdb.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/ipptopspsdb.py
r32518 r32541 59 59 AND batch_type = '" + batchType + "' \ 60 60 AND dvo_db = '" + dvoGpc1Label + "' \ 61 AND loaded_to_ODM != 0\61 AND (loaded_to_ODM = -1 OR merge_worthy = 1) \ 62 62 AND " + column + " = 0" 63 63 … … 129 129 130 130 ''' 131 Returns a list of processed batch IDs that have not yet been loaded to the ODM 132 NOTE we exclude batches already deleted from the datastore, as sometimes we delete stuff prior to 133 loading to ODM if there is a known problem with the batch 131 Returns a list of processed batch IDs that either not yet loaded to the ODM or not merge_worthy or not merged 132 NOTE we exclude batches already deleted from the datastore, as sometimes we delete stuff prior to loading to ODM if there is a known problem with the batch 133 ''' 134 def getAllUnfinishedBatchIDs(self, epoch, dvoGpc1Label, batchType): 135 136 sql = "SELECT batch_id \ 137 FROM batch \ 138 WHERE timestamp > '" + epoch + "' \ 139 AND dvo_db = '" + dvoGpc1Label + "' \ 140 AND loaded_to_datastore = 1 \ 141 AND batch_type = '" + batchType + "' \ 142 AND deleted_datastore = 0 \ 143 AND loaded_to_ODM != -1 \ 144 AND merge_worthy != -1 \ 145 AND merged = 0" 146 147 ids = [] 148 try: 149 rs = self.executeQuery(sql) 150 while (rs.next()): 151 ids.append(rs.getInt(1)) 152 except: 153 self.logger.exception("Can't query for unloaded batch ids in ipptopsps Db") 154 155 rs.close() 156 157 self.logger.debug("Found %d unloaded items" % len(ids)) 158 159 return ids 160 161 ''' 162 Returns a list of processed batch IDs that are not yet loaded to the ODM 163 NOTE we exclude batches already deleted from the datastore, as sometimes we delete stuff prior to loading to ODM if there is a known problem with the batch 134 164 ''' 135 165 def getUnloadedBatchIDs(self, epoch, dvoGpc1Label, batchType): 136 166 137 sql = "SELECT DISTINCTbatch_id \167 sql = "SELECT batch_id \ 138 168 FROM batch \ 139 169 WHERE timestamp > '" + epoch + "' \ … … 159 189 160 190 ''' 191 Returns a list of processed batch IDs that are not yet merge_worthy and that have not failed to load 192 NOTE we exclude batches already deleted from the datastore, as sometimes we delete stuff prior to loading to ODM if there is a known problem with the batch 193 ''' 194 def getUnmergeWorthyBatchIDs(self, epoch, dvoGpc1Label, batchType): 195 196 sql = "SELECT batch_id \ 197 FROM batch \ 198 WHERE timestamp > '" + epoch + "' \ 199 AND dvo_db = '" + dvoGpc1Label + "' \ 200 AND loaded_to_datastore = 1 \ 201 AND batch_type = '" + batchType + "' \ 202 AND merge_worthy = 0 \ 203 AND loaded_to_ODM != -1 \ 204 AND deleted_datastore = 0" 205 206 ids = [] 207 try: 208 rs = self.executeQuery(sql) 209 while (rs.next()): 210 ids.append(rs.getInt(1)) 211 except: 212 self.logger.exception("Can't query for un-mergeworthy batch ids in ipptopsps Db") 213 214 rs.close() 215 216 self.logger.debug("Found %d unloaded items" % len(ids)) 217 218 return ids 219 220 ''' 161 221 Returns a list of processed batch IDs that are merge_worthy, but not yet merged, for this epoch and dvo label 162 222 ''' 163 223 def getUnmergedBatchIDs(self, epoch, dvoGpc1Label, batchType): 164 224 165 sql = "SELECT DISTINCTbatch_id \166 FROM batch \ 167 WHERE timestamp > '" + epoch + "' \ 168 AND dvo_db = '" + dvoGpc1Label + "' \ 169 AND loaded_to_ODM= 1 \225 sql = "SELECT batch_id \ 226 FROM batch \ 227 WHERE timestamp > '" + epoch + "' \ 228 AND dvo_db = '" + dvoGpc1Label + "' \ 229 AND merge_worthy = 1 \ 170 230 AND batch_type = '" + batchType + "' \ 171 231 AND merged != 1"
Note:
See TracChangeset
for help on using the changeset viewer.
