def __init__(self, backup_mode='full', incr_basedir=None): self._backup_mode = backup_mode self.backup_record = {} threading.Thread.__init__(self) self.zkOpers = Requests_ZkOpers() self.dba_opers = DBAOpers() if self._backup_mode == "full": self.backupOpers = FullBackupOpers() else: self.backupOpers = IncrementBackupOpers(incr_basedir)
def post(self): incr_basedir = self.get_argument("incr_basedir", None) backup_type = self.get_argument("backup_type") if not backup_type: raise HTTPAPIErrorException( "backup params is not given, please check 'backup_type' params.", status_code=417) zkOper = Requests_ZkOpers() zkOper.write_backup_backup_info({"backup type": "backup is building"}) worker = DispatchBackupWorker(backup_type, incr_basedir) worker.start() result = {} result.setdefault("message", "backup process is running, please waiting") self.finish(result)
def __init__(self): BaseBackupWorker.__init__(self) self.zkOper = Requests_ZkOpers()
def retrieve_zkOper(self): if None == self.zkOper: self.zkOper = Requests_ZkOpers() return self.zkOper
def initialize(self): self.zk = Requests_ZkOpers()
def get_status(self, db_name): zk = Requests_ZkOpers() dml_status = zk.retrieve_sqlbatch_dml_status_info(db_name) return dml_status