def submitJob(self, job, ntimes=1, nums_threads=10, interval=1): """ submit one job and execute the same job ntimes, with nums_threads of threads """ if self.asyncJobMgr is None: self.asyncJobMgr = asyncJobMgr.asyncJobMgr(self.apiClient, self.dbConnection) self.asyncJobMgr.submitJobExecuteNtimes(job, ntimes, nums_threads, interval)
def submitJobs(self, jobs, nums_threads=10, interval=1): ''' @Desc :submit n jobs, execute them with nums_threads of threads ''' if self.__asyncJobMgr is None: self.__asyncJobMgr = asyncJobMgr(self.__apiClient, self.__dbConnection) self.__asyncJobMgr.submitJobs(jobs, nums_threads, interval)
def submitCmdsAndWait(self, cmds, workers=1, apiclient=None): ''' @Desc : FixME, httplib has issue if more than one thread submitted ''' if not apiclient: apiclient = self.__apiClient if self.__asyncJobMgr is None: self.__asyncJobMgr = asyncJobMgr(apiclient, self.__dbConnection) return self.__asyncJobMgr.submitCmdsAndWait(cmds, workers)
def submitJob(self, job, ntimes=1, nums_threads=10, interval=1): ''' @Desc : submit one job and execute the same job ntimes, with nums_threads of threads ''' if self.__asyncJobMgr is None: self.__asyncJobMgr = asyncJobMgr(self.__apiClient, self.__dbConnection) self.__asyncJobMgr.submitJobExecuteNtimes(job, ntimes, nums_threads, interval)
def submitJobs(self, jobs, nums_threads=10, interval=1): if self.asyncJobMgr is None: self.asyncJobMgr = asyncJobMgr.asyncJobMgr(self.apiClient, self.dbConnection) self.asyncJobMgr.submitJobs(jobs, nums_threads, interval)
def submitJob(self, job, ntimes=1, nums_threads=10, interval=1): if self.asyncJobMgr is None: self.asyncJobMgr = asyncJobMgr.asyncJobMgr(self.apiClient, self.dbConnection) self.asyncJobMgr.submitJobExecuteNtimes(job, ntimes, nums_threads, interval)
def submitCmdsAndWait(self, cmds, workers=1): if self.asyncJobMgr is None: self.asyncJobMgr = asyncJobMgr.asyncJobMgr(self.apiClient, self.dbConnection) return self.asyncJobMgr.submitCmdsAndWait(cmds, workers)
def dbConfigure(self, host="localhost", port=3306, user='******', passwd='cloud', db='cloud'): self.dbConnection = dbConnection.dbConnection(host, port, user, passwd, db) self.asyncJobMgr = asyncJobMgr.asyncJobMgr(self.apiClient, self.dbConnection)
def submitCmdsAndWait(self, cmds, workers=1): '''FixME, httplib has issue if more than one thread submitted''' if self.asyncJobMgr is None: self.asyncJobMgr = asyncJobMgr.asyncJobMgr(self.apiClient, self.dbConnection) return self.asyncJobMgr.submitCmdsAndWait(cmds, workers)
def submitJobs(self, jobs, nums_threads=10, interval=1): """submit n jobs, execute them with nums_threads of threads""" if self.asyncJobMgr is None: self.asyncJobMgr = asyncJobMgr.asyncJobMgr(self.apiClient, self.dbConnection) self.asyncJobMgr.submitJobs(jobs, nums_threads, interval)