Skip to content

2. Code and Data Setup

helena edited this page Nov 12, 2014 · 5 revisions

Clone the repo and build the code

git clone https://github.com/killrweather/killrweather.git
cd killrweather
sbt compile

Data Setup

Start your local Cassandra node. At the command line, cd to the /killrweather/data directory.

host:data helena$ cqlsh
Connected to Test Cluster at 127.0.0.1:9042. 
[cqlsh 5.0.1 | Cassandra 2.1.0 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cqlsh> source 'create-timeseries.cql';
cqlsh> source 'load-timeseries.cql';
cqlsh> describe keyspace isd_weather_data;
cqlsh> use isd_weather_data;
cqlsh:isd_weather_data> select * from weather_station limit 10;
 

 id           | call_sign | country_code | elevation | lat    | long    | name                  | state_code
--------------+-----------+--------------+-----------+--------+---------+-----------------------+------------
 408930:99999 |      OIZJ |           IR |         4 |  25.65 |  57.767 |                  JASK |       null
 725500:14942 |      KOMA |           US |     299.3 | 41.317 |   -95.9 | OMAHA EPPLEY AIRFIELD |         NE
 725474:99999 |      KCSQ |           US |       394 | 41.017 | -94.367 |               CRESTON |         IA
 480350:99999 |      VBLS |           BM |       749 | 22.933 |   97.75 |                LASHIO |       null
 719380:99999 |      CYCO |           CN |        22 | 67.817 | -115.15 |    COPPERMINE AIRPORT |       null
 992790:99999 |     DB279 |           US |         3 |   40.5 | -69.467 |   ENVIRONM BUOY 44008 |       null
  85120:99999 |      LPPD |           PO |        72 | 37.733 |   -25.7 |   PONTA DELGADA/NORDE |       null
 150140:99999 |      LRBM |           RO |       218 | 47.667 |  23.583 |             BAIA MARE |       null
 435330:99999 |      null |           MV |         1 |  6.733 |   73.15 |              HANIMADU |       null
 536150:99999 |      null |           CI |      1005 | 38.467 |  106.27 |       YINCHUAN (CITY) |       null 

(10 rows)

cqlsh:isd_weather_data>      

If you ever want to clear everything out and start fresh just:

cqlsh> drop keyspace isd_weather_data;

Note: In Production you would use the NetworkTopologyStrategy and a mimimum replication factor of 3. NetworkTopologyStrategy

Setup Project In Intellij

Intellij 13 or earlier, run the following (nothing needed for >= 14)

sbt gen-idea