Changeset 35417 for trunk/ippToPsps/jython/dvo.py
- Timestamp:
- Apr 19, 2013, 4:35:54 PM (13 years ago)
- Location:
- trunk/ippToPsps
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
jython/dvo.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20130307/ippToPsps (added) merged: 35350,35352,35369,35402-35404,35413
- Property svn:mergeinfo changed
-
trunk/ippToPsps/jython/dvo.py
r35223 r35417 193 193 p = Popen(cmd, shell=True, stdout=PIPE) 194 194 p.wait() 195 if p.returncode != 0: 196 self.logger.errorPair("dvopsps failed on SkyTable.fits for ", self.skychunk.dvoLocation) 197 raise 195 198 196 199 self.logger.infoPair("Adding index to", self.scratchDb.dvoSkyTable) … … 591 594 def nativeIngestDetections(self, boxId, boxDim): 592 595 593 # XXX put the chunk below in a separate method594 # blow away existing dvoDetection table595 596 596 # clear the 'ingested' field for all boxes owned by this host 597 597 self.ippToPspsDb.clearIngestedBoxes(self.scratchDb.dbHost) … … 607 607 ## raise 608 608 609 # drop detections table 610 self.logger.infoPair("Dropping table", self.scratchDb.dvoDetectionTable) 611 self.scratchDb.dropTable(self.scratchDb.dvoDetectionTable) 612 613 # create detections table 614 self.logger.infoPair("Creating table", self.scratchDb.dvoDetectionTable) 615 sql = "CREATE TABLE " + self.scratchDb.dvoDetectionTable + " LIKE dvoDetection" 616 try: self.scratchDb.execute(sql) 617 except: 618 self.logger.errorPair("Unable to create table", self.scratchDb.dvoDetectionTable) 609 # blow away existing dvoDetection table & re-crate 610 if not self.scratchDb.resetDvoDetectionTable(): 611 self.logger.errorPair("Unable to reset scratch table", "DvoDetectionFull") 619 612 return False 620 self.scratchDb.changeEngineToInnoDB(self.scratchDb.dvoDetectionTable)621 622 # add fileID column623 sql = "ALTER TABLE " + self.scratchDb.dvoDetectionTable + " ADD fileID INT NOT NULL"624 try: self.scratchDb.execute(sql)625 except:626 self.logger.errorPair("Unable to add fileID column to ", self.scratchDb.dvoDetectionTable)627 return False628 629 # add an index to the fileID column630 self.scratchDb.createIndex(self.scratchDb.dvoDetectionTable, "fileID")631 613 632 614 # make sure we have an up-to-date Images table … … 665 647 p = Popen(cmd, shell=True, stdout=PIPE) 666 648 p.wait() 649 if p.returncode != 0: 650 self.logger.errorPair("dvopsps failed on ", self.scratchDb.dvoDetectionTable) 651 raise 667 652 668 653 ## dvopsps can take a very long time. try 2 or 3 times to re-establish communication with the db before proceeding? … … 670 655 self.ippToPspsDb.setIngestedBox(boxId, self.scratchDb.dbHost) 671 656 672 # add fileID column657 # run 'ANALYZE' to get indexes up-to-snuff 673 658 sql = "ANALYZE TABLE " + self.scratchDb.dvoDetectionTable 674 659 try: self.scratchDb.execute(sql)
Note:
See TracChangeset
for help on using the changeset viewer.
