/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
DybPython::dbdumpload::DBDumpLoad Class Reference

List of all members.

Public Member Functions

def __init__
def load_
def dump_
def __call__

Public Attributes

 args
 dbc

Detailed Description

Definition at line 170 of file dbdumpload.py.


Constructor & Destructor Documentation

def DybPython::dbdumpload::DBDumpLoad::__init__ (   self,
  args 
)
:param sect: section in config file  

Definition at line 171 of file dbdumpload.py.

00172                              :
00173         """
00174         :param sect: section in config file  
00175         """
00176         self.args = args
00177         self.dbc = DBConf(sect=args.dbsect)
   

Member Function Documentation

def DybPython::dbdumpload::DBDumpLoad::load_ (   self)
:return: the command to perform the load

Definition at line 178 of file dbdumpload.py.

00178                    : 
00179         """
00180         :return: the command to perform the load
00181         """
00182         path = self.args.path
00183         assert os.path.exists(path) , "load_ ERROR : need an existing path to a mysqldump file : %s " % path
00184         lodr = MySQLLoad(self.dbc)
00185         lodr['path'] = path
00186         return lodr.cmd
00187 
def DybPython::dbdumpload::DBDumpLoad::dump_ (   self)
:return: the command to perform the dump

Definition at line 188 of file dbdumpload.py.

00188                    : 
00189         """
00190         :return: the command to perform the dump
00191         """
00192         if self.args.gbcheck:
00193             du = disk_usage(self.args.path)
00194             if du['gb_free'] < float(self.args.gbcheck):
00195                 log.warn("free space %5.2f G less than requested %5.2f G\n%s" % ( du["gb_free"], float(self.args.gbcheck), repr(du) ) )
00196                 return "echo not enough free space to perform a dump based on requested gb from  '--gbcheck' argument "
00197             else:
00198                 log.debug("free space %5.2f G more than requested %5.2f G\n%s " % ( du["gb_free"], float(self.args.gbcheck), repr(du) ) )   
00199 
00200         dmpr = MySQLDumpWhere(self.dbc)
00201         dmpr['path'] = self.args.path
00202         dmpr['where'] = self.args.where
00203         dmpr['direct'] = ">>"  if self.args.append else ">"
00204         dmpr['tables'] = self.args.tables
00205         dmpr['no_data'] = "--no-data" if self.args.no_data else ""
00206         return dmpr.cmd
00207 
def DybPython::dbdumpload::DBDumpLoad::__call__ (   self)

Definition at line 208 of file dbdumpload.py.

00209                       :
00210         cmd = self.args.cmd + "_"
00211         if hasattr(self, cmd ):
00212             return getattr( self , cmd)()   
00213         else:
00214             raise Exception("cmd %s not implemented " % cmd)
00215 
00216 


Member Data Documentation

Definition at line 173 of file dbdumpload.py.

Definition at line 173 of file dbdumpload.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:55:40 for DybPython by doxygen 1.7.4