Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hector for Cassandra

I can't set up Hector for Cassandra. I've looked through the documentation and the Cassandra wiki. The problem with these docs is that a lot of the information there is outdated, or minimalistic (or I'm lacking knowledge). Anyway, I'm wondering if anyone can provide some rough simplistic guide as to how to go about installing it.

I'm aiming to build a JSP page that can use the Cassandra database.

What I've done so far:

  • I've downloaded Hector 1.0-2 and Cassandra 1.0.7.
  • I've set up Cassandra and checked it works (used CLI to create new columns using keys)
  • Tried unpacking the me.prettyprint.cassandra into the Java project directory but still nothing.

I'm also not sure where to get the thrift API (or how to install it)? And, if i need it at all?

Any help would be appreciated.

like image 844
Lyuben Todorov Avatar asked Oct 23 '22 10:10

Lyuben Todorov


1 Answers

As I remember, it was very easy to install Cassandra, and get Hector to work for a basic insert, retrieve example. It's like

  • Install Cassandra
  • Create keyspace, and column families from Cassandra CLI.
  • Create a plain Java Maven project, and add Hector, and Thrift dependencies to it. (Maven is not necessary, I just meant a simple hello-world project here.)
  • Write insert code, then check into Cassandra using CLI.
  • Write retrieve query, then see if matches, and slices properly.

But that was Cassandra 0.6.0. Not sure what so hard.

Please look into this tutorial, and you can also see this simple source code for insertion. If you land into some trouble come with specific problem, it will be much easier that way.

Hope this helps.

like image 111
Nishant Avatar answered Oct 31 '22 15:10

Nishant