Databases Reference
In-Depth Information
with an associated counter, showing the number of users that visited other products in
the same category. This helps sellers to understand their customers' needs. The topol-
ogy receives a navigation log and updates the product stats as shown in the Figure 6-5 .
Figure 6-5. Storm topology inputs and outputs
Our Storm Topology has five components: one spout to feed it and four bolts to get
the job done.
UsersNavigationSpout
Reads from the users navigation queue and feeds the topology
GetCategoryBolt
Reads the product information from the Redis Server and adds its category to the
stream
UserHistoryBolt
Reads the products previously navigated by the user and emits Product:Category
pairs to update the counters in the next step
ProductCategoriesCounterBolt
Keeps track of the number of times that users viewed a product of a specific category
NewsNotifierBolt
Tells the web application to update the user interface immediately
Here's how the topology is created (see Figure 6-6 ):
package storm . analytics ;
...
public class TopologyStarter {
public static void main ( String [] args ) {
Logger . getRootLogger (). removeAllAppenders ();
TopologyBuilder builder = new TopologyBuilder ();
 
Search WWH ::




Custom Search