Max
Max

Reputation: 95

How to write an Apache Storm program

To write a program to submit to a storm cluster, does it need to be in a specific format or can I submit any basic program?

I'm trying to write as simple of a program as possible just to see if the cluster is working properly and to make sure I understand the software.

Upvotes: 0

Views: 291

Answers (2)

Hariprasad Taduru
Hariprasad Taduru

Reputation: 181

To test the cluster, there are many programs already written. These programs are part of storm tar file. Use them directly.

Upvotes: 0

Matthias J. Sax
Matthias J. Sax

Reputation: 62350

A most basic program must implement a spout (ie, IRichSpout interface or BaseRichSpout class). Additionally, you must use TopologyBuilder to create a StormTopology. See here for a simple example:

https://github.com/apache/storm/blob/master/examples/storm-starter/src/jvm/storm/starter/WordCountTopology.java

See here for a tutorial:

https://storm.apache.org/documentation/Tutorial.html

Furthermore, you must package your code into a jar file and submit via StormSubmitter:

https://storm.apache.org/documentation/Running-topologies-on-a-production-cluster.html

Upvotes: 1

Related Questions