Last active
August 29, 2015 14:25
-
-
Save forcemax/2a39b3f11bd424840b34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static TopologyBuilder wireTopology() { | |
TopologyBuilder builder = new TopologyBuilder(); | |
// Twitter API Key | |
String consumerKey = "consumerKey"; | |
String consumerSecret = "consumerSecret"; | |
String accessToken = "accessToken"; | |
String accessTokenSecret = "accessTokenSecret"; | |
String[] keyWords = new String[0]; | |
builder.setSpout("twitter", new TwitterSpout(consumerKey, consumerSecret, accessToken, accessTokenSecret, keyWords)); | |
builder.setBolt("extractHashTag", new ExtractHashTagBolt(), 6).shuffleGrouping("twitter"); | |
builder.setBolt("rollingCount", new RollingCountBolt(60, 5), 12).fieldsGrouping("extractHashTag", new Fields("word")); | |
builder.setBolt("intermediateRanking", new IntermediateRankingsBolt(TOP_N, 5), 6).fieldsGrouping("rollingCount", new Fields("obj")); | |
builder.setBolt("totalRanker", new TotalRankingsBolt(TOP_N, 10)).globalGrouping("intermediateRanking"); | |
builder.setBolt("print", new PrinterBolt(), 2).shuffleGrouping("totalRanker"); | |
return builder; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment