示例#1
0
class SleepingMapper(TMapper):
    def __init__(self, ctx):
        super(SleepingMapper, self).__init__(ctx)
        self.timer = Timer(ctx)

    def map(self, ctx):
        with self.timer.time_block("sleep"):
            time.sleep(.001)
        super(SleepingMapper, self).map(ctx)
示例#2
0
class SleepingMapper(TMapper):

    def __init__(self, ctx):
        super(SleepingMapper, self).__init__(ctx)
        self.timer = Timer(ctx)

    def map(self, ctx):
        with self.timer.time_block("sleep"):
            time.sleep(0.001)
        super(SleepingMapper, self).map(ctx)
示例#3
0
 def __init__(self, up_link, private_encoding=True, fast_combiner=False):
     self._fast_combiner = fast_combiner
     self.private_encoding = private_encoding
     self._private_encoding = False
     self.up_link = up_link
     self.writer = None
     self.partitioner = None
     self._job_conf = None
     self._key = None
     self._value = None
     self.n_reduces = None
     self._values = None
     self._input_split = None
     self._input_key_class = None
     self._input_value_class = None
     self._status = None
     self._status_set = False
     self._progress_float = 0.0
     self._last_progress = 0
     self._registered_counters = []
     self.timer = Timer(self, 'Pydoop TaskContext')
     # None = unknown (yet), e.g., while setting conf.  In this
     # case, *both* is_mapper() and is_reducer() must return False
     self._is_mapper = None
示例#4
0
 def __init__(self, ctx):
     super(SleepingMapper, self).__init__(ctx)
     self.timer = Timer(ctx)
示例#5
0
 def __init__(self, ctx):
     super(SleepingMapper, self).__init__(ctx)
     self.timer = Timer(ctx)