Building and running step 5

Add a table to collect the statistics of the Playlist application, and modify Playlist to display the statistics to users.

Add a table to store the statistics collected for the Playlist application, and build and run the modified application.

Prerequisites

You must have set up your environment before starting this step.

Procedure

  1. In a terminal, go to the playlist workspace.
    cd playlist
  2. Check out the step5 branch using git.
    git checkout step5
  3. Run the cqlsh command.
    cqlsh
  4. In the playlist keyspace create the users and playlist_tracks tables.
    use playlist;
    CREATE TABLE statistics (counter_name text PRIMARY KEY, counter_value counter);
  5. Quit cqlsh.
    exit;
  6. Build and run Playlist using mvn.
    mvn verify cargo:run
  7. In a web browser, navigate to: http://localhost:8080/playlist

    On the home page click Statistics to view the current statistics. As you browse through the database, create new playlists, and attempt to log-in as a user, the statistics are updated.

What's next

Proceed to Step 6: Optimize the Playlist application.