Changeset 35183
- Timestamp:
- Feb 20, 2013, 9:49:30 AM (13 years ago)
- Location:
- trunk/ippToPsps
- Files:
-
- 4 edited
-
config/ippToPspsDbSchema.sql (modified) (1 diff)
-
jython/dvo.py (modified) (2 diffs)
-
jython/ipptopspsdb.py (modified) (2 diffs)
-
jython/loader.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/config/ippToPspsDbSchema.sql
r35097 r35183 62 62 `dec_center` float default NULL, 63 63 `box_side` float default NULL, 64 `ingested` tinyint(1) default '0',64 `ingested` varchar(64) default NULL, 65 65 PRIMARY KEY (`id`), 66 66 KEY `fk_skychunk` (`skychunk`), -
trunk/ippToPsps/jython/dvo.py
r35181 r35183 587 587 # blow away existing dvoDetection table 588 588 589 # clear the 'ingested' field for all boxes 590 # XXX oops: this causes problems for multiple loaders... 591 # set/clear should be using the HOST id as the value in the table. 592 # self.ippToPspsDb.clearIngestedBoxes() 589 # clear the 'ingested' field for all boxes owned by this host 590 self.ippToPspsDb.clearIngestedBoxes(self.scratchDb.dbHost) 593 591 592 print "*******************************************************************************" 593 self.logger.warning("about to delete detection table and re-ingest; is this correct?") 594 response = raw_input("(y/n) ") 595 if response != "y": 596 raise 597 self.logger.warning("Are you ABSOLUTELY sure you want to do this?") 598 response = raw_input("(y/n) ") 599 if response != "y": 600 raise 601 594 602 # drop detections table 595 603 self.logger.infoPair("Dropping table", self.scratchDb.dvoDetectionTable) … … 644 652 ## dvopsps can take a very long time. try 2 or 3 times to re-establish communication with the db before proceeding? 645 653 646 self.ippToPspsDb.setIngestedBox(boxId )654 self.ippToPspsDb.setIngestedBox(boxId, self.scratchDb.dbHost) 647 655 648 656 # add fileID column -
trunk/ippToPsps/jython/ipptopspsdb.py
r35175 r35183 1097 1097 Inserts new box into box table. If it already exisits, it returns existing box id 1098 1098 ''' 1099 def setIngestedBox(self, id ):1099 def setIngestedBox(self, id, host): 1100 1100 1101 1101 # set the field 'ingested' to 1 for this box 1102 sql = "update box set ingested = 1where id = " + str(id)1102 sql = "update box set ingested = '" + host + "' where id = " + str(id) 1103 1103 try: 1104 1104 self.execute(sql) … … 1108 1108 1109 1109 ''' 1110 Inserts new box into box table. If it already exisits, it returns existing box id1111 ''' 1112 def clearIngestedBoxes(self ):1110 Clear ingested flag for boxes owned by this host 1111 ''' 1112 def clearIngestedBoxes(self, host): 1113 1113 1114 1114 # set the field 'ingested' to 1 for this box 1115 sql = "update box set ingested = 0"1115 sql = "update box set ingested = 'none' where ingested = '" + host + "'" 1116 1116 try: 1117 1117 self.execute(sql) 1118 1118 except: 1119 print "failed to clear boxes as ingested"1119 print "failed to clear ingested state for boxes owned by host ", host 1120 1120 raise 1121 1121 -
trunk/ippToPsps/jython/loader.py
r35179 r35183 148 148 149 149 ids = self.ippToPspsDb.getPendingIdsForThisBox(boxId, batchType) 150 150 151 151 # ids are the stage_ids for items to be processed (eg, stack_id for a stack CMF, cam_id for P2 smf) 152 152
Note:
See TracChangeset
for help on using the changeset viewer.
