aboutsummaryrefslogtreecommitdiff
path: root/wordcount/topologies
diff options
context:
space:
mode:
Diffstat (limited to 'wordcount/topologies')
-rw-r--r--wordcount/topologies/wordcount.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/wordcount/topologies/wordcount.py b/wordcount/topologies/wordcount.py
new file mode 100644
index 0000000..d66e1b3
--- /dev/null
+++ b/wordcount/topologies/wordcount.py
@@ -0,0 +1,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)