aboutsummaryrefslogtreecommitdiff
path: root/wordcount/resources/topology.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'wordcount/resources/topology.yaml')
-rw-r--r--wordcount/resources/topology.yaml73
1 files changed, 73 insertions, 0 deletions
diff --git a/wordcount/resources/topology.yaml b/wordcount/resources/topology.yaml
new file mode 100644
index 0000000..725f3be
--- /dev/null
+++ b/wordcount/resources/topology.yaml
@@ -0,0 +1,73 @@
+# topology definition
+
+# name to be used when submitting. This is what shows up...
+# in the Storm UI/storm command-line tool as the topology name
+# when submitted to Storm
+name: "wordcount"
+
+# Topology configuration
+config:
+ # Hint for the number of workers to create
+ topology.workers: 1
+
+# Spout definitions
+spouts:
+ - id: "sentence-spout"
+ className: "org.apache.storm.flux.wrappers.spouts.FluxShellSpout"
+ constructorArgs:
+ # Command line
+ - ["python", "sentencespout.py"]
+ # Output field(s)
+ - ["sentence"]
+ # parallelism hint
+ parallelism: 1
+
+# Bolt definitions
+bolts:
+ - id: "splitter-bolt"
+ className: "org.apache.storm.flux.wrappers.bolts.FluxShellBolt"
+ constructorArgs:
+ # Command line
+ - ["python", "splitbolt.py"]
+ # Output field(s)
+ - ["word"]
+ parallelism: 1
+
+ - id: "counter-bolt"
+ className: "org.apache.storm.flux.wrappers.bolts.FluxShellBolt"
+ constructorArgs:
+ # Command line
+ - ["python", "countbolt.py"]
+ # Output field(s)
+ - ["word","count"]
+ parallelism: 1
+
+ # Logging
+ - id: "log"
+ className: "org.apache.storm.flux.wrappers.bolts.LogInfoBolt"
+ parallelism: 1
+
+# Stream definitions
+streams:
+ - name: "Spout --> Splitter" # name isn't used (placeholder for logging, UI, etc.)
+ # The stream emitter
+ from: "sentence-spout"
+ # The stream consumer
+ to: "splitter-bolt"
+ # Grouping type
+ grouping:
+ type: SHUFFLE
+
+ - name: "Splitter -> Counter"
+ from: "splitter-bolt"
+ to: "counter-bolt"
+ grouping:
+ type: FIELDS
+ # field(s) to group on
+ args: ["word"]
+
+ - name: "Counter -> Log"
+ from: "counter-bolt"
+ to: "log"
+ grouping:
+ type: SHUFFLE \ No newline at end of file