예제 #1
0
def get(key, job = None):
        try:
                job = job or this_name()
                return load_oob("http://" + this_master(), job, key)
        except comm.CommException, x:
                data_err("OOB key (%s) not found at %s: HTTP status '%s'" %\
                        (key, url, x.http_code), key)
예제 #2
0
파일: core.py 프로젝트: jseppanen/disco
 def oob_get(self, name, key):
     try:
         return util.load_oob(self.host, name, key)
     except CommError, e:
         if e.http_code == 404:
             raise DiscoError("Unknown key or job name")
         raise
예제 #3
0
파일: task.py 프로젝트: AlexArgus/disco
    def get(self, key):
        """
        Gets an out-of-band result for the task with the key *key*.

        Given the semantics of OOB results, this means that only the reduce
        phase can access results produced in the preceding map phase.
        """
        from disco.util import load_oob
        return load_oob(self.master, self.jobname, key)
예제 #4
0
    def get(self, key):
        """
        Gets an out-of-band result for the task with the key *key*.

        Given the semantics of OOB results, this means that only the reduce
        phase can access results produced in the preceding map phase.
        """
        from disco.util import load_oob
        return load_oob(self.master, self.jobname, key)
예제 #5
0
파일: worker.py 프로젝트: jseppanen/disco
def get(key, job=None):
    """
    Gets an out-of-band result assigned with the key *key*. The job name *job*
    defaults to the current job.

    Given the semantics of OOB results (see above), this means that the default
    value is only good for the reduce phase which can access results produced
    in the preceding map phase.
    """
    return load_oob('http://%s' % Task.master, job or Task.name, key)
예제 #6
0
    def get(self, key, job=None):
        """
        Gets an out-of-band result assigned with the key *key*. The job name *job*
        defaults to the current job.

        Given the semantics of OOB results (see above), this means that the default
        value is only good for the reduce phase which can access results produced
        in the preceding map phase.
        """
        return util.load_oob(self.master, job or self.jobname, key)
예제 #7
0
    def oob_get(self, name, key):
        """
        Returns an out-of-band value assigned to *key* for the job *name*.

        See :mod:`disco.node.worker` for more information on using OOB.
        """
        try:
            return util.load_oob(self.master, name, key)
        except CommError, e:
            if e.code == 404:
                raise DiscoError("Unknown key or job name")
            raise
예제 #8
0
파일: core.py 프로젝트: mshron/disco
    def oob_get(self, name, key):
        """
        Returns an out-of-band value assigned to *key* for the job *name*.

        See :mod:`disco.node.worker` for more information on using OOB.
        """
        try:
            return util.load_oob(self.master, name, key)
        except CommError, e:
            if e.code == 404:
                raise DiscoError("Unknown key or job name")
            raise
예제 #9
0
    def oob_get(self, jobname, key):
        """
        Returns an out-of-band value assigned to *key* for the job.

        OOB data can be stored and retrieved for job tasks using
        :meth:`disco.task.Task.get` and :meth:`disco.task.Task.put`.
        """
        try:
            return util.load_oob(self.master, jobname, key)
        except CommError, e:
            if e.code == 404:
                raise DiscoError("Unknown key or jobname")
            raise
예제 #10
0
파일: core.py 프로젝트: hmas/disco
    def oob_get(self, jobname, key):
        """
        Returns an out-of-band value assigned to *key* for the job.

        OOB data can be stored and retrieved for job tasks using
        :meth:`disco.task.Task.get` and :meth:`disco.task.Task.put`.
        """
        try:
            return util.load_oob(self.master, jobname, key)
        except CommError as e:
            if e.code == 404:
                raise DiscoError("Unknown key or jobname")
            raise
예제 #11
0
 def map(e, params):
     x = bytes_to_str(load_oob(Task.master, params['job'], e))
     assert x == 'value:{0}'.format(e)
     yield 'good', ''
예제 #12
0
파일: test_oob.py 프로젝트: caox/disco
 def map(e, params):
     x = bytes_to_str(load_oob(Task.master, params['job'], e))
     assert x == 'value:{0}'.format(e)
     yield 'good', ''
예제 #13
0
파일: test_oob.py 프로젝트: Dieterbe/disco
 def map(e, params):
     x = load_oob(Task.master, params['job'], e)
     assert x == 'value:%s' % e
     yield 'good', ''
예제 #14
0
 def map(e, params):
     x = load_oob(Task.master, params['job'], e)
     assert x == 'value:%s' % e
     yield 'good', ''
예제 #15
0
파일: core.py 프로젝트: chenhao7512/disco
 def oob_get(self, name, key):
         return util.load_oob(self.host, name, key)