Database Reference
In-Depth Information
An Example of Storm Topology
On the master server, I build the storm-starter topology code under $STORM_HOME/examples/storm-starter.
The build creates a jar file that can be run against the cluster under a directory called “target” at this level:
[hadoop@hc1nn ~]$ cd $STORM_HOME/examples/storm-starter
[hadoop@hc1nn storm-starter]$ ls -l
total 2888
drwxr-xr-x. 3 hadoop hadoop 4096 May 6 07:13 multilang
-rw-r--r--. 1 hadoop hadoop 5191 Jun 14 08:35 pom.xml
-rw-r--r--. 1 hadoop hadoop 4825 May 29 04:24 README.markdown
drwxr-xr-x. 4 hadoop hadoop 4096 May 6 07:13 src
-rw-r--r--. 1 hadoop hadoop 2927299 Jun 14 08:57 storm-starter-topologies-0.9.2-incubating.jar
drwxr-xr-x. 3 hadoop hadoop 4096 May 6 07:13 test
I then use Apache Maven version 3.2.1 to build this package:
[hadoop@hc1nn storm-starter]$ mvn package
........................
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:16 min
[INFO] Finished at: 2014-07-27T13:57:49+12:00
[INFO] Final Memory: 25M/59M
[INFO] ------------------------------------------------------------------------
I have truncated the build output for purposes of this example, but if you get to this success line, then all is good.
So, I check to see that the built library exists:
[hadoop@hc1nn storm-starter]$ ls -lrt target/storm-starter-*-incubating-jar-with-dependencies.jar
-rw-rw-r--. 1 hadoop hadoop 2927301 Jul 27 13:57 target/storm-starter-0.9.2-incubating-jar-with-
dependencies.jar
if you want to know which topologies are available for use, you can look at the Java source code under
$StorM_hoMe/examples/storm-starter/src/jvm/storm/starter. it might be useful to have a look at this code to familiarize
yourself with how it works. also, check the apache Storm website ( storm.incubator.apache.org ) documentation for
topology coding examples.
Note
[hadoop@hc1nn storm-starter]$ cd $STORM_HOME/examples/storm-starter/src/jvm/storm/starter
[hadoop@hc1nn starter]$ ls *.java
BasicDRPCTopology.java ReachTopology.java TransactionalWords.java
ExclamationTopology.java RollingTopWords.java WordCountTopology.java
ManualDRPC.java SingleJoinExample.java
PrintSampleStream.java TransactionalGlobalCount.java
 
 
Search WWH ::




Custom Search