/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
DybDbi::propagate_grouping::SeqnoTranche Class Reference

List of all members.

Public Member Functions

def __init__
def contains
def kludge_insertdates
def __repr__

Public Attributes

 db
 n
 mi
 mx
 index
 seqnos
 title

Detailed Description

Representation of a contiguous range of SEQNO in an unspecified DBI Vld table 

Definition at line 44 of file propagate_grouping.py.


Constructor & Destructor Documentation

def DybDbi::propagate_grouping::SeqnoTranche::__init__ (   self,
  db,
  n,
  mi,
  mx,
  index,
  kwa 
)
:param n: SEQNO count
:param mi: minimum SEQNO
:param mx: maximum SEQNO
:param kwa: metadata

Definition at line 48 of file propagate_grouping.py.

00049                                                     :
00050         """
00051         :param n: SEQNO count
00052         :param mi: minimum SEQNO
00053         :param mx: maximum SEQNO
00054         :param kwa: metadata
00055         """
00056         dict.__init__(self, **kwa)
00057         assert mx - mi + 1 == n , ( mi, mx, n , "expecting contiguous SEQNO groups " ) 
00058         self.db = db
00059         self.n  = n
00060         self.mi = mi
00061         self.mx = mx
00062         self.index = index
00063         self.seqnos = range(mi,mx+1)
00064         self.title = "tranche %s seqnos %s:%s " % ( self.index, self.mi, self.mx ) 


Member Function Documentation

def DybDbi::propagate_grouping::SeqnoTranche::contains (   self,
  seqno 
)

Definition at line 65 of file propagate_grouping.py.

00066                               :
00067         return seqno in self.seqnos

def DybDbi::propagate_grouping::SeqnoTranche::kludge_insertdates (   self,
  tn,
  insertdate = None 
)
:param tn: table name
:param insertdate:

Applies lowlevel mysql update query to kludge the INSERTDATE for the SEQNO range  

.. warn:: This is **NOT FOR USE ON PRODUCTION DB**  

Definition at line 68 of file propagate_grouping.py.

00069                                                       :
00070         """
00071         :param tn: table name
00072         :param insertdate:
00073 
00074         Applies lowlevel mysql update query to kludge the INSERTDATE for the SEQNO range  
00075 
00076         .. warn:: This is **NOT FOR USE ON PRODUCTION DB**  
00077 
00078         """
00079         assert self.db.sect == 'tmp_offline_db', "the kludging of INSERTDATEs is for testing only, for real DB SOP must be used "
00080         if not insertdate:
00081             insertdate = datetime.utcnow()
00082         if isinstance( insertdate, datetime ):
00083             insertdate = insertdate.strftime('%Y-%m-%d %H:%M:%S')
00084         elif isinstance( insertdate, str ):
00085             assert len(insertdate) == 19, ("expecting standard mysql time string", insertdate)
00086         else:
00087             raise Exception("insertdate not handled %s " % insertdate )
00088 
00089         sql = "update %(tn)sVld set INSERTDATE='%(insertdate)s' where SEQNO >= %(mi)s and SEQNO <= %(mx)s "  % dict(tn=tn,mi=self.mi,mx=self.mx,insertdate=insertdate)
00090         log.warn("kludging %s " % sql )
00091         for r in self.db(sql):
00092             log.warn(r)

def DybDbi::propagate_grouping::SeqnoTranche::__repr__ (   self)

Definition at line 93 of file propagate_grouping.py.

00094                       :
00095         return "%s index %s n %-4s mi %-4s mx %-4s seqnos %s %s " % (self.__class__.__name__,self.index, self.n,self.mi,self.mx,repr(self.seqnos)[0:70], repr(dict(self)) )   
00096 
00097 


Member Data Documentation

Definition at line 53 of file propagate_grouping.py.

Definition at line 53 of file propagate_grouping.py.

Definition at line 53 of file propagate_grouping.py.

Definition at line 53 of file propagate_grouping.py.

Definition at line 53 of file propagate_grouping.py.

Definition at line 53 of file propagate_grouping.py.

Definition at line 53 of file propagate_grouping.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:57:24 for DybDbi by doxygen 1.7.4