Exemplo n.º 1
0
    def loadJobsByRunningAttr( self, runningAttrs=None, jobAttributes=None, all=False, strict=True, limit=None, offset=None, jobList=None ) :
        """
        retrieve job information from db for job
        whose running instance match attributes
        """

        # db connect
        if self.db is None :
            self.connect()

        # creating running jobs
        if runningAttrs is None :
            run = RunningJob()
        else:
            run = RunningJob( runningAttrs )

        # creating jobs
        if jobAttributes is None :
            job = Job()
        else :
            job = Job( jobAttributes )

        # if requested, with a right join is possible to fill a running
        # instance where missing
        if all :
            jType = 'right'
        else :
            jType = ''

        # load bunch of jobs?
        if jobList is None or jobList == [] :
            inList = None
        else :
            inList = {'jobId' : jobList}

        # load job from db
        jMap = { 'jobId' : 'jobId',
                 'taskId' : 'taskId',
                 'submissionNumber' : 'submission' }
        options = { 'strict' : strict,
                    'jType'  : jType,
                    'limit'  : limit,
                    'offset' : offset,
                    'inList' : inList }

        runJobList = self.db.selectJoin( job, run, \
                                         jMap=jMap , \
                                         options=options )

        # recall jobs
        for job, runningJob in runJobList :
            job.setRunningInstance( runningJob )

        # return
        return [key[0] for key in runJobList]
Exemplo n.º 2
0
    def loadJobsByTimestamp(self,
                            more,
                            less,
                            runningAttrs=None,
                            jobAttributes=None):
        """
        retrieve job information from db for job
        whose running instance match attributes
        """

        # db connect
        if self.db is None:
            self.connect()

        # creating running jobs
        if runningAttrs is None:
            run = RunningJob()
        else:
            run = RunningJob(runningAttrs)

        # creating jobs
        if jobAttributes is None:
            job = Job()
        else:
            job = Job(jobAttributes)

        # load job from db
        jMap = {
            'jobId': 'jobId',
            'taskId': 'taskId',
            'submissionNumber': 'submission'
        }

        runJobList = self.db.selectJoin( job, run, \
                                         jMap=jMap, \
                                         less=less, \
                                         more=more )

        # recall jobs
        for job, runningJob in runJobList:
            job.setRunningInstance(runningJob)

        # return
        return [key[0] for key in runJobList]
Exemplo n.º 3
0
    def loadJobsByTimestamp( self, more, less, runningAttrs=None, jobAttributes=None) :
        """
        retrieve job information from db for job
        whose running instance match attributes
        """

        # db connect
        if self.db is None :
            self.connect()

        # creating running jobs
        if runningAttrs is None :
            run = RunningJob()
        else:
            run = RunningJob( runningAttrs )

        # creating jobs
        if jobAttributes is None :
            job = Job()
        else :
            job = Job( jobAttributes )

        # load job from db
        jMap = { 'jobId' : 'jobId',
                 'taskId' : 'taskId',
                 'submissionNumber' : 'submission' }

        runJobList = self.db.selectJoin( job, run, \
                                         jMap=jMap, \
                                         less=less, \
                                         more=more )

        # recall jobs
        for job, runningJob in runJobList :
            job.setRunningInstance( runningJob )

        # return
        return [key[0] for key in runJobList]
Exemplo n.º 4
0
    def loadJobsByRunningAttr(self,
                              runningAttrs=None,
                              jobAttributes=None,
                              all=False,
                              strict=True,
                              limit=None,
                              offset=None,
                              jobList=None):
        """
        retrieve job information from db for job
        whose running instance match attributes
        """

        # db connect
        if self.db is None:
            self.connect()

        # creating running jobs
        if runningAttrs is None:
            run = RunningJob()
        else:
            run = RunningJob(runningAttrs)

        # creating jobs
        if jobAttributes is None:
            job = Job()
        else:
            job = Job(jobAttributes)

        # if requested, with a right join is possible to fill a running
        # instance where missing
        if all:
            jType = 'right'
        else:
            jType = ''

        # load bunch of jobs?
        if jobList is None or jobList == []:
            inList = None
        else:
            inList = {'jobId': jobList}

        # load job from db
        jMap = {
            'jobId': 'jobId',
            'taskId': 'taskId',
            'submissionNumber': 'submission'
        }
        options = {
            'strict': strict,
            'jType': jType,
            'limit': limit,
            'offset': offset,
            'inList': inList
        }

        runJobList = self.db.selectJoin( job, run, \
                                         jMap=jMap , \
                                         options=options )

        # recall jobs
        for job, runningJob in runJobList:
            job.setRunningInstance(runningJob)

        # return
        return [key[0] for key in runJobList]