Skip to content

MiraLak/accelerometer-rest-to-cassandra

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

accelerometer-rest-to-cassandra

REST API receiving accelorometers data and storing them into Cassandra. Each acceleration contains:

  • date when it has been captured as a timestamp (eg, 1428773040488)
  • acceleration force along the x axis (unit is m/s²)
  • acceleration force along the y axis (unit is m/s²)
  • acceleration force along the z axis (unit is m/s²)

Prerequisites

Start Cassandra

First step is to start Cassandra: sudo sh /bin/cassandra

We don't need any specific configuration, so Cassandra can be started using the default configuration. Cassandra will listen on http://localhost:9042

Next step is to start the console to use CQL: sudo sh /bin/cqlsh

Then now you can execute the command listed in the project data.cql

Start the application

gradle build && java -jar build/libs/accelerometer-rest-to-cassandra-1.0.jar

Use the API

  • Header Content-Type must be set: application/json
  • body:
{
  "timestamp": 1428773040488,
  "x": 0.98,
  "y": 6.43,
  "z": 9.01,
}
  • returned status: 201 CREATED
  • return the last prediction result
  • Header Content-Type must be set: application/json
  • body:
{
  "user_id": "user1",
  "activity": "walking",
  "timestamp": 1428773040488,
  "x": 0.98,
  "y": 6.43,
  "z": 9.01,
}
  • returned status: 201 CREATED

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%