- Timestamp:
- Apr 3, 2013, 12:52:33 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130307/ippToPsps/jython/dvo.py
r35223 r35352 591 591 def nativeIngestDetections(self, boxId, boxDim): 592 592 593 # XXX put the chunk below in a separate method594 # blow away existing dvoDetection table595 596 593 # clear the 'ingested' field for all boxes owned by this host 597 594 self.ippToPspsDb.clearIngestedBoxes(self.scratchDb.dbHost) … … 607 604 ## raise 608 605 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) 606 # blow away existing dvoDetection table & re-crate 607 if not self.scratchDb.resetDvoDetectionTable(): 608 self.logger.errorPair("Unable to reset scratch table", "DvoDetectionFull") 619 609 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 610 632 611 # make sure we have an up-to-date Images table … … 665 644 p = Popen(cmd, shell=True, stdout=PIPE) 666 645 p.wait() 646 if p.returncode != 0: 647 self.logger.errorPair("dvopsps failed on ", self.scratchDb.dvoDetectionTable) 648 raise 667 649 668 650 ## dvopsps can take a very long time. try 2 or 3 times to re-establish communication with the db before proceeding? … … 670 652 self.ippToPspsDb.setIngestedBox(boxId, self.scratchDb.dbHost) 671 653 672 # add fileID column654 # run 'ANALYZE' to get indexes up-to-snuff 673 655 sql = "ANALYZE TABLE " + self.scratchDb.dvoDetectionTable 674 656 try: self.scratchDb.execute(sql)
Note:
See TracChangeset
for help on using the changeset viewer.
