(https://github.com/nathanmarz/STORM/downloads)
2. Download Twitter4j 2.2.5+
(http://twitter4j.org/en/index.html)
3. Create a New "Java Project" in Eclipse
4. Include all jars from STORM (as Project Libraries -> External Jars) STOMR-0.5.3.jar lib/* (Every Jar in the /lib directory)
5. Include two jars from Twitter4j (as Project Libraries -> External Jars)
twitter4j-core-2.2.5
twitter4j-stream
6. Now to run locally, you'll need to create a Topology with a main method that submits it to a LocalCluster. For good examples, check out the storm-starter project. The easiest for me to see was the PrintSampleStream.java topology but a lot of people seem to prefer ExclamationTopology.java.
Note that if you use the PrintSampleStream, you'll need to modify TwitterSampleSpout.java to print the status in the onStatus method.
For example, you can include this before the "queue.offer(...)" call:
System.out.println(status.getUser().getName() + " : " + status.getText());
This is probably beginner stuff to a lot of you, but I had a lot of trouble getting these steps down. Hopefully it will help someone else.
Thanks to Nathan Marz for all of the wonderful support!
使用 storm-starter maven 建立依赖,STORM包会有,4不执行。Twitter4j一般是被墙了。下载后执行5.
执行程序。报错
ERROR org.apache.zookeeper.server.NIOServerCnxn - Thread Thread[main,5,main] died
java.io.IOException:
Unable to delete file: C:\DOCUME~1\××××\LOCALS~1\Temp\cfc5313d-a0bd-42a6-9738-4b97d55958da\version-2\log.1
权限问题?