Sample twitter trending topology application. This Java application builds a
topology that reads from a file of tweets, extracts the hashtags from each
line, and uses a window to keep track of the most popular hashtags from the
past 40,000 tweets.
Although the application reads from a file, in principle it could be attached
to a live data source.
If no arguments are provided then the topology is executed in embedded mode,
within this JVM.
This may be executed from the samples/java/functional
directory as:
ant run.twitter.trending
- Using Apache Ant, this will run in embedded
mode and assumes tweets are in CSV files in $HOME/tweets
.
-
java -cp functionalsamples.jar:../../../com.ibm.streamsx.topology/lib/com.ibm.streamsx.topology.jar:$STREAMS_INSTALL/lib/com.ibm.streams.operator.samples.jar
twitter.TwitterTrending CONTEXT_TYPE DIRECTORY
- Run directly from the command line.
CONTEXT_TYPE is one of:
DISTRIBUTED
- Run as an IBM Streams distributed
application.
STANDALONE
- Run as an IBM Streams standalone
application.
EMBEDDED
- Run embedded within this JVM.
BUNDLE
- Create an IBM Streams application bundle.
TOOLKIT
- Create an IBM Streams application toolkit.
and DIRECTORY is the location of a directory that contains one or more
text files containing lines of tweets.
-
An application execution within your IDE once you set the class path to include the correct jars.