aboutsummaryrefslogtreecommitdiff
path: root/wordcount/resources
diff options
context:
space:
mode:
Diffstat (limited to 'wordcount/resources')
-rw-r--r--wordcount/resources/log4j2.xml18
-rw-r--r--wordcount/resources/topology.yaml73
2 files changed, 91 insertions, 0 deletions
diff --git a/wordcount/resources/log4j2.xml b/wordcount/resources/log4j2.xml
new file mode 100644
index 0000000..d2b2981
--- /dev/null
+++ b/wordcount/resources/log4j2.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- See http://logging.apache.org/log4j/2.x/manual/configuration.html
+ for more information on Log4j configuration. -->
+<Configuration>
+ <Appenders>
+ <Console name="STDOUT" target="SYSTEM_OUT">
+ <PatternLayout pattern="%d{HH:mm:ss} [%t] %-5level %logger{36} - %msg%n"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <Logger name="com.microsoft.example" level="trace" additivity="false">
+ <AppenderRef ref="STDOUT"/>
+ </Logger>
+ <Root level="error">
+ <Appender-Ref ref="STDOUT"/>
+ </Root>
+ </Loggers>
+</Configuration> \ No newline at end of file
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