IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35183


Ignore:
Timestamp:
Feb 20, 2013, 9:49:30 AM (13 years ago)
Author:
eugene
Message:

box.ingested value is now the hostname

Location:
trunk/ippToPsps
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/config/ippToPspsDbSchema.sql

    r35097 r35183  
    6262  `dec_center` float default NULL,
    6363  `box_side` float default NULL,
    64   `ingested` tinyint(1) default '0',
     64  `ingested` varchar(64) default NULL,
    6565  PRIMARY KEY  (`id`),
    6666  KEY `fk_skychunk` (`skychunk`),
  • trunk/ippToPsps/jython/dvo.py

    r35181 r35183  
    587587        # blow away existing dvoDetection table
    588588
    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)
    593591       
     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
    594602        # drop detections table
    595603        self.logger.infoPair("Dropping table", self.scratchDb.dvoDetectionTable)
     
    644652        ## dvopsps can take a very long time. try 2 or 3 times to re-establish communication with the db before proceeding?
    645653
    646         self.ippToPspsDb.setIngestedBox(boxId)
     654        self.ippToPspsDb.setIngestedBox(boxId, self.scratchDb.dbHost)
    647655
    648656        # add fileID column
  • trunk/ippToPsps/jython/ipptopspsdb.py

    r35175 r35183  
    10971097    Inserts new box into box table. If it already exisits, it returns existing box id
    10981098    '''
    1099     def setIngestedBox(self, id):
     1099    def setIngestedBox(self, id, host):
    11001100
    11011101        # set the field 'ingested' to 1 for this box
    1102         sql = "update box set ingested = 1 where id = " + str(id)
     1102        sql = "update box set ingested = '" + host + "' where id = " + str(id)
    11031103        try:
    11041104            self.execute(sql)
     
    11081108
    11091109    '''
    1110     Inserts new box into box table. If it already exisits, it returns existing box id
    1111     '''
    1112     def clearIngestedBoxes(self):
     1110    Clear ingested flag for boxes owned by this host
     1111    '''
     1112    def clearIngestedBoxes(self, host):
    11131113
    11141114        # 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 + "'"
    11161116        try:
    11171117            self.execute(sql)
    11181118        except:
    1119             print "failed to clear boxes as ingested"
     1119            print "failed to clear ingested state for boxes owned by host ", host
    11201120            raise
    11211121
  • trunk/ippToPsps/jython/loader.py

    r35179 r35183  
    148148
    149149                    ids = self.ippToPspsDb.getPendingIdsForThisBox(boxId, batchType)
    150                 
     150               
    151151                    # ids are the stage_ids for items to be processed (eg, stack_id for a stack CMF, cam_id for P2 smf)
    152152
Note: See TracChangeset for help on using the changeset viewer.