O'Reilly logo

Storm Real-time Processing Cookbook by Quinton Anderson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Counting and persisting log statistics

There are many statistics that can be gathered for log streams; for the purposes of this recipe and to illustrate the concept, only a single-time series will be dealt with (log volume per minute); however, this should fully illustrate the design and approach for implementing other analyses.

How to do it…

  1. Download and install the storm-cassandra contrib project into your Maven repository:
    git clone https://github.com/quintona/storm-cassandra
    cd storm-cassandra
    mvn clean install
    
  2. Create a new BaseRichBolt class called VolumeCountingBolt in the storm.cookbook.log package. The bolt must declare three output fields:
    public void declareOutputFields(OutputFieldsDeclarer declarer) { declarer.declare(new Fields(FIELD_ROW_KEY, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required