/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Public Attributes | Private Member Functions
Scraper::daq::fileinfo::DaqFiles Class Reference

List of all members.

Public Member Functions

def __init__
def range
def runs
def newfiles

Public Attributes

 source
 cfg
 kstf
 qdaq
 single session closured in
 qdaqr
 first
 last

Private Member Functions

def _first
def _last

Detailed Description

Definition at line 7 of file fileinfo.py.


Constructor & Destructor Documentation

def Scraper::daq::fileinfo::DaqFiles::__init__ (   self,
  source,
  cfg = {} 
)
Queries ``SFO_TZ_FILE`` to find files with records that have not yet been propagated offline

Definition at line 8 of file fileinfo.py.

00008                                     {} ):
00009         """
00010         Queries ``SFO_TZ_FILE`` to find files with records that have not yet been propagated offline
00011 
00012         """
00013         kstf = source.kls_("SFO_TZ_FILE")
00014         def _kstf__repr__(self):
00015             return "%s %s %s %s" % ( self.__class__.__name__, self.RUNNR, self.OPENTIME, self.LFN )
00016         kstf.__repr__ = _kstf__repr__
00017  
00018         self.source = source
00019         self.cfg = cfg 
00020         self.kstf = kstf
00021 
00022         daq = self.source()            ## single session closured in 
00023         self.qdaq  = lambda *qwn:daq.query(*qwn).order_by(kstf.OPENTIME).filter(kstf.FILESTATE == 'CLOSED')
00024         self.qdaqr = lambda *qwn:daq.query(*qwn).order_by(kstf.OPENTIME.desc()).filter(kstf.FILESTATE == 'CLOSED')
00025 

Member Function Documentation

def Scraper::daq::fileinfo::DaqFiles::range (   self)
DAQ Query recording `first` and `last` closed entries, in OPENTIME order 

Definition at line 26 of file fileinfo.py.

00027                    :
00028         """
00029         DAQ Query recording `first` and `last` closed entries, in OPENTIME order 
00030         """
00031         self.first = self._first()
00032         self.last  = self._last()
00033         log.info("first %s " % self.first )
00034         log.info("last  %s " % self.last  )

def Scraper::daq::fileinfo::DaqFiles::runs (   self,
  startlocal 
)
:param startlocal: local datetime after which are interested in DAQ files

Return ``RUNNR`` corresponding to files closed after `startlocal` in ``OPENTIME`` order  

Definition at line 35 of file fileinfo.py.

00036                                  :
00037         """
00038         :param startlocal: local datetime after which are interested in DAQ files
00039 
00040         Return ``RUNNR`` corresponding to files closed after `startlocal` in ``OPENTIME`` order  
00041         """
00042         kstf = self.kstf
00043         maxFilesPerRun = self.cfg.get('maxFilesPerRun',1000)
00044         q = self.qdaq(kstf.RUNNR).filter(kstf.OPENTIME>startlocal).distinct()
00045         daqruns = [run for run, in q.limit(maxFilesPerRun).all()]   
00046         log.info("qfter %s yields %s daqruns " % ( startlocal, len(daqruns) )) 
00047         return daqruns

def Scraper::daq::fileinfo::DaqFiles::_first (   self) [private]

Definition at line 48 of file fileinfo.py.

00049                     :
        return self.qdaq(self.kstf).first()
def Scraper::daq::fileinfo::DaqFiles::_last (   self) [private]

Definition at line 50 of file fileinfo.py.

00051                    :
00052         return self.qdaqr(self.kstf).first()

def Scraper::daq::fileinfo::DaqFiles::newfiles (   self,
  startlocal,
  offnames = [] 
)
:param offnames: list of LFN of already collected files

Definition at line 53 of file fileinfo.py.

00054                                                   :
00055          """
00056          :param offnames: list of LFN of already collected files
00057          """
00058          kstf = self.kstf
00059          maxFilesPerRun = self.cfg.get('maxFilesPerRun',1000)
00060          daq = self.source()
00061          q = self.qdaq(kstf).filter(kstf.OPENTIME>startlocal)
00062          if len(offnames) > 0:    
00063              daqfiles = q.filter(~kstf.LFN.in_(offnames)).limit(maxFilesPerRun).all()  ## "NOT IN_" 
00064          else:
00065              daqfiles = q.limit(maxFilesPerRun).all()  
00066          return daqfiles
00067 
00068     


Member Data Documentation

Definition at line 11 of file fileinfo.py.

Definition at line 11 of file fileinfo.py.

Definition at line 11 of file fileinfo.py.

single session closured in

Definition at line 12 of file fileinfo.py.

Definition at line 12 of file fileinfo.py.

Definition at line 28 of file fileinfo.py.

Definition at line 28 of file fileinfo.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:50:03 for Scraper by doxygen 1.7.4