-
Notifications
You must be signed in to change notification settings - Fork 3
GettingStarted
In this chapter the installation process is described together with simple test to control whether everything is running normally.
##Prerequisites In order to work with SensorStorm you need:
- java SDK 1.7 or higher;
- to install beforehand storm 0.9.2 binaries (Apache Storm downloads) which are needed to deploy Storm topologies on a cluster;
- Eclipse with Java perspective and Maven integration (M2E).
#Make it ready to work There are 3 repositories in SensorStorm library:
- sensorstorm;
- external-storm-config;
- sensorstorm-examples.
- First step is to download source code from git repo.
- Second step is to import the project SensorStorm into Eclipse by using directive: Import: Existing Maven project. It will add all three repositories as 3 apart projects to Eclipse.
- sensorstorm is the project dependent on external-storm-config, so to succesfully build the projects:
- run command Run->Maven install on external-storm-configuration (the result should be: build successful);
- run command Run->Maven install on sensorstorm project (the result should be: build successful).
It would go through the build process, run the available tests and create jar with all dependencies in target folder. After that step SensorStorm is ready to use.
- To check whether it works correctly is possible by starting the examples-sensor-storm Main.class To be able to do that:
- run command Run->Maven install sensorstorm-examples (the result should be: build successful);
- Run Main.java class. It should start two examples one be one, so you can see in the logging console: It should start two examples one be one, so you can see in the logging console first starting zookeeper cluster, then storm infrastructure preparation, and after the execution of tests.
In the Console as you run the examples, it should be output like that for the first example:
61507 [Thread-16-printspeed] INFO nl.tno.sensorstorm.timer.TimerParticleHandler -
TimerParticleHandler initiated for operation nl.tno.sensorstorm.example.PrintParticleSpeedOperation
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
Particle (nl.tno.sensorstorm.timer.TimerTickParticle) routed to bolts [[4, 5]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
Particle (nl.tno.sensorstorm.timer.TimerTickParticle) routed to bolts [[2, 3]]
Particle (nl.tno.sensorstorm.timer.TimerTickParticle) routed to bolts [[6, 7]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.timer.TimerTickParticle) routed to bolts [[6, 7]]
Particle (nl.tno.sensorstorm.timer.TimerTickParticle) routed to bolts [[4, 5]]
Particle (nl.tno.sensorstorm.timer.TimerTickParticle) routed to bolts [[4, 5]]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
Particle (nl.tno.sensorstorm.timer.TimerTickParticle) routed to bolts [[4, 5]]
Particle (nl.tno.sensorstorm.timer.TimerTickParticle) routed to bolts [[4, 5]]
Received Particle: SensorParticle [sensorId=sensor_1, mesaurement=1.0, timestamp=1419429239390]
1419429240390: Number of precessed particles since the last 1000 milliseconds: 11
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
Received Particle: SensorParticle [sensorId=sensor_1, mesaurement=1.0, timestamp=1419429239490]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
Received Particle: SensorParticle [sensorId=sensor_1, mesaurement=1.0, timestamp=1419429239590]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
Received Particle: SensorParticle [sensorId=sensor_1, mesaurement=1.0, timestamp=1419429239690]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
Received Particle: SensorParticle [sensorId=sensor_1, mesaurement=1.0, timestamp=1419429239790]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
Received Particle: SensorParticle [sensorId=sensor_1, mesaurement=1.0, timestamp=1419429239890]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
Received Particle: SensorParticle [sensorId=sensor_1, mesaurement=1.0, timestamp=1419429239990]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
Received Particle: SensorParticle [sensorId=sensor_1, mesaurement=0.75, timestamp=1419429240090]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
Received Particle: SensorParticle [sensorId=sensor_1, mesaurement=0.5555555555555556, timestamp=1419429240190]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
Received Particle: SensorParticle [sensorId=sensor_1, mesaurement=0.4, timestamp=1419429240290]
Particle (nl.tno.sensorstorm.timer.TimerTickParticle) routed to bolts [[2, 3]]
Particle (nl.tno.sensorstorm.timer.TimerTickParticle) routed to bolts [[6, 7]]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.timer.TimerTickParticle) routed to bolts [[6, 7]]
Particle (nl.tno.sensorstorm.timer.TimerTickParticle) routed to bolts [[4, 5]]
Particle (nl.tno.sensorstorm.timer.TimerTickParticle) routed to bolts [[4, 5]]
1419429241390: Number of precessed particles since the last 1000 milliseconds: 9
Particle (nl.tno.sensorstorm.timer.TimerTickParticle) routed to bolts [[4, 5]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
Particle (nl.tno.sensorstorm.timer.TimerTickParticle) routed to bolts [[4, 5]]
Received Particle: SensorParticle [sensorId=sensor_1, mesaurement=0.2, timestamp=1419429240390]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
Received Particle: SensorParticle [sensorId=sensor_1, mesaurement=0.0, timestamp=1419429240490]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
Received Particle: SensorParticle [sensorId=sensor_1, mesaurement=-0.2, timestamp=1419429240590]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[6]]
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[4]]
Received Particle: SensorParticle [sensorId=sensor_1, mesaurement=-0.4, timestamp=1419429240690]
selected bolt 2 based on field sensorId(sensor_1)
Particle (nl.tno.sensorstorm.example.SensorParticle) routed to bolts [[2]]
etc...
The available simple examples in details can be found further in "Simple examples of library use section".
##Simple examples of library use This chapter provides also a short introduction to creating the new topologies for Twitter Storm network from scratch and their further management using SensorStorm library.
- Moving average: Fetcher, Batcher bolt
- Every specified time period print of how may tuples were proceed.