Skip to content
Abhishek Singh Bailoo edited this page Jun 18, 2015 · 1 revision

## Overview

Java-Ingester-Sample is a sample program in Java to do data operation on Cassandra. Three kinds of operations are inserting data, query data, and delete data. This sample program is using Datastax Java Driver for Cassandra.

## Parts

There are three parts in this sample program:

  1. Database Connection manager part This part is mainly in CassandraConn.java class. This class will take parameters from a configuration files named config.properties located in src/main/resources/config.properties. In config.properties file you define the nodes IP address and the keyspace.

  2. Data Object part This part contains java classes that represent the data in Cassandra. These classes are in src/main/java/in/co/itracksolution/model. There are two classes FullData and LastData. Each represent the two tables / Column Family.

  3. Data Operation part This part is the one that do data operation on Cassandra. This part classes is in src/main/java/in/co/itracksolution/dao. All operations for the data of both table are in LastDataDao and FullDataDao. The usage for these operations are in the src/main/java/in/co/itracksolution.

## To Run

The sample code in Java-Ingester-Sample is basically running the classes in src/main/java/in/co/itracksolution. These classes uses the DAO classes in src/main/java/in/co/itracksolution/dao. The classes name in src/main/java/in/co/itracksolution imply what function and database operation the classes do. Each classes src/main/java/in/co/itracksolution are to be run independently.

Clone this wiki locally