aboutsummaryrefslogtreecommitdiff
path: root/wordcount/topologies/wordcount.py
blob: d66e1b328eadf333e485bfdf9ee91238e6e9333d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
"""
Word count topology
"""

from streamparse import Grouping, Topology

from bolts.wordcount import WordCountBolt
from spouts.words import WordSpout


class WordCount(Topology):
    word_spout = WordSpout.spec()
    count_bolt = WordCountBolt.spec(inputs={word_spout: Grouping.fields("word")}, par=2)