Beispiel #1
0
    def process(self, tup):
        request_id, args = tup.values

        args = re.sub(r' {2,}', ' ', args)
        args = [int(x) for x in args.split(' ')]
        total = args[0]

        for arg in args[1:]:
            total += arg

        BasicBolt.emit([request_id, total])
Beispiel #2
0
    def process(self, tup):
        request_id, args = tup.values

        args = re.sub(r' {2,}', ' ', args)
        args = [int(x) for x in args.split(' ')]
        total = args[0]

        for arg in args[1:]:
            total += arg

        BasicBolt.emit([request_id, total])
Beispiel #3
0
 def process(self, tup):
     for word in tup.values:
         self.word_count[word] += 1
         BasicBolt.emit([word, self.word_count[word]])
 def process(self, tup):
     sentence = tup.values[0]
     for word in sentence.split(' '):
         BasicBolt.emit(word)
Beispiel #5
0
 def process(self, tup):
     sentence = tup.values[0]
     for word in sentence.split(' '):
         BasicBolt.emit(word)