aboutsummaryrefslogtreecommitdiff
path: root/wordcount/topologies
diff options
context:
space:
mode:
authorCody Hiar <cody@hiar.ca>2021-10-10 11:13:47 -0600
committerCody Hiar <cody@hiar.ca>2021-10-10 11:13:47 -0600
commit5367edb8b37a6dac76ac7cd608ac3c005b7b225e (patch)
treeff2a381fba100dc1c7961e625f372f63e2998dcd /wordcount/topologies
Work in progress
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)