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

In This Package:

Classes | Functions | Variables
DybPython::vlut::scan Namespace Reference

Classes

class  perdict
class  Scan

Functions

def dbifullscan

Variables

tuple log = logging.getLogger(__name__)
tuple __all__ = ('Scan','perdict')
tuple loc_mtime = lambdapath:datetime.datetime.fromtimestamp(os.stat(path)[stat.ST_MTIME])
tuple utc_mtime = lambdapath:datetime.datetime.utcfromtimestamp(os.stat(path)[stat.ST_MTIME])
string ordering = ""
tuple vs = VlutSpec( dbconf="tmp_offline_db".split(), tn='CableMap', ctx=None, opts=dict(_rescan=True,ordering=ordering) )
tuple scan = Scan.get_or_create( vs )

Function Documentation

def DybPython::vlut::scan::dbifullscan (   vs)
Perform fullscan for all DBI tables in a single DB, saving the per-table scans 
at location given by `vs`. This func is performed in subprocesses for full DBI stack control.

:param dbconf: config section
:param tab: table name or None to traverse all payload tables
:param ctx: context dict passed to fullscan or None to traverse all contexts

Definition at line 14 of file scan.py.

00015                      :
00016     """
00017     Perform fullscan for all DBI tables in a single DB, saving the per-table scans 
00018     at location given by `vs`. This func is performed in subprocesses for full DBI stack control.
00019 
00020     :param dbconf: config section
00021     :param tab: table name or None to traverse all payload tables
00022     :param ctx: context dict passed to fullscan or None to traverse all contexts
00023     """ 
00024     from DybDbi import gDbi
00025     gDbi.level = 'WARNING'
00026 
00027     dbconf, tab, ctx, opts  = vs.coords_()
00028 
00029     with envvar(DBCONF=dbconf):
00030         db = DB()
00031         ptabs = [tab] if tab else db.showpaytables
00032         for tn in ptabs: 
00033             ta = db.tab(tn)
00034             insertdate = ta.vlast('INSERTDATE')
00035             if not insertdate:
00036                 log.error("skipping empty table %s " % tn )
00037                 continue 
00038             ctxs = [ctx] if ctx else ta.actual_ctxs()
00039             for _ctx in ctxs:
00040                 v = vs.spawn( ctx=_ctx)
00041                 path = v.path
00042 
00043                 stamp = utc_mtime(path) if os.path.exists(path) else None
00044                 if stamp == None or insertdate > stamp or vs.rescan:
00045                     log.info("cache miss : fullscan %s %s to %s %s " % (tn, _ctx, path, opts))
00046                     fs = ta.fullscan( _ctx , opts )
00047                     fss = Scan(fs)
00048                     fss.save( path )
00049                     if vs.txtscan:
00050                         fss.txtsave( path+'txt')
00051                 else: 
00052                     log.info("cached hit : fullscan %s %s %s still valid " % (tn, _ctx, path))
00053 


Variable Documentation

tuple DybPython::vlut::scan::log = logging.getLogger(__name__)

Definition at line 6 of file scan.py.

Definition at line 8 of file scan.py.

tuple DybPython::vlut::scan::loc_mtime = lambdapath:datetime.datetime.fromtimestamp(os.stat(path)[stat.ST_MTIME])

Definition at line 10 of file scan.py.

tuple DybPython::vlut::scan::utc_mtime = lambdapath:datetime.datetime.utcfromtimestamp(os.stat(path)[stat.ST_MTIME])

Definition at line 11 of file scan.py.

Definition at line 247 of file scan.py.

tuple DybPython::vlut::scan::vs = VlutSpec( dbconf="tmp_offline_db".split(), tn='CableMap', ctx=None, opts=dict(_rescan=True,ordering=ordering) )

Definition at line 249 of file scan.py.

Definition at line 250 of file scan.py.

| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:55:41 for DybPython by doxygen 1.7.4