Cassandra client

69 views
Skip to first unread message

Jonas Bonér

unread,
Mar 29, 2010, 8:28:49 AM3/29/10
to akka...@googlegroups.com
As you know Akka has it's own Cassandra client adding scala API,
pooling etc. Bases on Viktor's code.

But it is a pain to maintain. Now I found Hector. Seems to impl all we
have plus reconnect, loadbalancing etc.

http://prettyprint.me/2010/03/03/load-balancing-and-improved-failover-in-hector/

Should we drop our own and use Hector?
Add a Scala API around.
Anyone feel it would be fun to do?

--
Jonas Bonér
http://jayway.com
http://akkasource.org

Viktor Klang

unread,
Mar 29, 2010, 11:10:27 AM3/29/10
to akka...@googlegroups.com
On Mon, Mar 29, 2010 at 2:28 PM, Jonas Bonér <jo...@jonasboner.com> wrote:
As you know Akka has it's own Cassandra client adding scala API, pooling etc. Bases on Viktor's code.

But it is a pain to maintain.

Sorry to hear that :-( I admit to have dropped the ball on Cassidy, I simply have no time to spare for that project :(
 
Now I found Hector. Seems to impl all we have plus reconnect, loadbalancing etc.

http://prettyprint.me/2010/03/03/load-balancing-and-improved-failover-in-hector/

Should we drop our own and use Hector?
Add a Scala API around.
Anyone feel it would be fun to do?

--
Jonas Bonér
http://jayway.com
http://akkasource.org

--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.




--
Viktor Klang
| "A complex system that works is invariably
| found to have evolved from a simple system
| that worked." - John Gall

Akka - the Actor Kernel: Akkasource.org
Twttr: twitter.com/viktorklang

Jonas Bonér

unread,
Mar 29, 2010, 12:08:22 PM3/29/10
to akka...@googlegroups.com
It is not painful due to your code but that Cassandra is changing API all the time and I don't have time to do it. Better for me to outsource the thing, eg use another lib. It also has some features we currently not have bur which are nice. 

Viktor Klang

unread,
Mar 29, 2010, 12:14:19 PM3/29/10
to akka...@googlegroups.com
On Mon, Mar 29, 2010 at 6:08 PM, Jonas Bonér <jo...@jonasboner.com> wrote:
It is not painful due to your code but that Cassandra is changing API all the time and I don't have time to do it. Better for me to outsource the thing, eg use another lib. It also has some features we currently not have bur which are nice. 

+1 on all you said.
I'm totally cool with this.

Thanks for bringing it up :-)
 

Tupshin Harper

unread,
Mar 29, 2010, 12:41:11 PM3/29/10
to akka...@googlegroups.com
I've been using Hector recently for a small project, and can look into
integrating it into Cassandra.

-Tupshin

Ike

unread,
Apr 7, 2010, 11:33:21 AM4/7/10
to Akka User List
Getting Hector to work in Scala is very straightforward but the
resulting code is not very Scala-ish. I wrote a little bit about it
here: http://theikester.wordpress.com/2010/04/07/access-cassandra-from-scala-hector/.

I also considered wrapping it in Scala but, given Cassandra's and
Hector's fast dev pace, that would introduce yet another moving target
to maintain. Then there's the question about what "the right" API
should be Scala. Viktor had:

// session => session | (key, new ColumnPath("Standard1", null,
column1))

which borrows from the Thrift API. Scalandra does:

// cassandra.ColumnFamily("Standard1")("key")("column1")

which looks pretty clean, but I couldn't get it to work with the
latest version of Cassandra. And then there's the new kid on the block
Cascal which does:

// session.get("Test" \ "Standard1" \ "key" \ "column1")

Any thoughts from the more Scala savvy among us? I'm not a fan of the
back-slash character as separator but not sure that argument
parenthesis are better. Should we also consider "->" and ">"?

On Mar 29, 8:28 am, Jonas Bonér <jo...@jonasboner.com> wrote:
> As you know Akka has it's own Cassandra client adding scala API,  
> pooling etc. Bases on Viktor's code.
>
> But it is a pain to maintain. Now I found Hector. Seems to impl all we  
> have plus reconnect, loadbalancing etc.
>

> http://prettyprint.me/2010/03/03/load-balancing-and-improved-failover...

Jonas Bonér

unread,
Apr 9, 2010, 3:15:58 AM4/9/10
to akka...@googlegroups.com
On 7 April 2010 17:33, Ike <ike...@gmail.com> wrote:
> Getting Hector to work in Scala is very straightforward but the
> resulting code is not very Scala-ish. I wrote a little bit about it
> here: http://theikester.wordpress.com/2010/04/07/access-cassandra-from-scala-hector/.
>
> I also considered wrapping it in Scala but, given Cassandra's and
> Hector's fast dev pace, that would introduce yet another moving target
> to maintain. Then there's the question about what "the right" API

Then it is probably better to wait. What we have is working ok.

> should be Scala. Viktor had:
>
> // session => session | (key, new ColumnPath("Standard1", null,
> column1))
>
> which borrows from the Thrift API. Scalandra does:
>
> // cassandra.ColumnFamily("Standard1")("key")("column1")
>
> which looks pretty clean, but I couldn't get it to work with the
> latest version of Cassandra. And then there's the new kid on the block
> Cascal which does:
>
> // session.get("Test" \ "Standard1" \ "key" \ "column1")
>
> Any thoughts from the more Scala savvy among us? I'm not a fan of the
> back-slash character as separator but not sure that argument

I actually like the backslash, make it very easy to understand.
Navigate like a filesystem.

> parenthesis are better. Should we also consider "->" and ">"?
>
> On Mar 29, 8:28 am, Jonas Bonér <jo...@jonasboner.com> wrote:
>> As you know Akka has it's own Cassandra client adding scala API,
>> pooling etc. Bases on Viktor's code.
>>
>> But it is a pain to maintain. Now I found Hector. Seems to impl all we
>> have plus reconnect, loadbalancing etc.
>>
>> http://prettyprint.me/2010/03/03/load-balancing-and-improved-failover...
>>
>> Should we drop our own and use Hector?
>> Add a Scala API around.
>> Anyone feel it would be fun to do?
>>
>> --
>> Jonas Bonérhttp://jayway.comhttp://akkasource.org
>

> --
> You received this message because you are subscribed to the Google Groups "Akka User List" group.
> To post to this group, send email to akka...@googlegroups.com.
> To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
>
>

--
Jonas Bonér

work: http://jayway.com
code: http://akkasource.org
blog: http://jonasboner.com
twitter: @jboner

Ike

unread,
Apr 9, 2010, 8:49:59 AM4/9/10
to Akka User List

On Apr 9, 3:15 am, Jonas Bonér <jbo...@gmail.com> wrote:


> On 7 April 2010 17:33, Ike <ikes...@gmail.com> wrote:
>
> > Getting Hector to work in Scala is very straightforward but the
> > resulting code is not very Scala-ish. I wrote a little bit about it

> > here:http://theikester.wordpress.com/2010/04/07/access-cassandra-from-scal....


>
> > I also considered wrapping it in Scala but, given Cassandra's and
> > Hector's fast dev pace, that would introduce yet another moving target
> > to maintain. Then there's the question about what "the right" API
>
> Then it is probably better to wait. What we have is working ok.
>
>
>
>
>
> > should be Scala. Viktor had:
>
> > // session => session | (key, new ColumnPath("Standard1", null,
> > column1))
>
> > which borrows from the Thrift API. Scalandra does:
>
> > // cassandra.ColumnFamily("Standard1")("key")("column1")
>
> > which looks pretty clean, but I couldn't get it to work with the
> > latest version of Cassandra. And then there's the new kid on the block
> > Cascal which does:
>
> > // session.get("Test" \ "Standard1" \ "key" \ "column1")
>
> > Any thoughts from the more Scala savvy among us? I'm not a fan of the
> > back-slash character as separator but not sure that argument
>
> I actually like the backslash, make it very easy to understand.
> Navigate like a filesystem.
>

Yes, like an MS-DOS filesystem :) But kidding aside I agree. I like
the hierarchy implication, even if it's only 2 or 3 levels deep. I
think it is a good metaphor for the dimensions in Cassandra.

>
>
>
> > parenthesis are better. Should we also consider "->" and ">"?
>
> > On Mar 29, 8:28 am, Jonas Bonér <jo...@jonasboner.com> wrote:
> >> As you know Akka has it's own Cassandra client adding scala API,
> >> pooling etc. Bases on Viktor's code.
>
> >> But it is a pain to maintain. Now I found Hector. Seems to impl all we
> >> have plus reconnect, loadbalancing etc.
>
> >>http://prettyprint.me/2010/03/03/load-balancing-and-improved-failover...
>
> >> Should we drop our own and use Hector?
> >> Add a Scala API around.
> >> Anyone feel it would be fun to do?
>
> >> --
> >> Jonas Bonérhttp://jayway.comhttp://akkasource.org
>
> > --
> > You received this message because you are subscribed to the Google Groups "Akka User List" group.
> > To post to this group, send email to akka...@googlegroups.com.
> > To unsubscribe from this group, send email to akka-user+...@googlegroups.com.

> > For more options, visit this group athttp://groups.google.com/group/akka-user?hl=en.

Jonas Bonér

unread,
Apr 9, 2010, 9:00:50 AM4/9/10
to akka...@googlegroups.com
On 9 April 2010 14:49, Ike <ike...@gmail.com> wrote:
>
>
> On Apr 9, 3:15 am, Jonas Bonér <jbo...@gmail.com> wrote:
>> On 7 April 2010 17:33, Ike <ikes...@gmail.com> wrote:
>>
>> > Getting Hector to work in Scala is very straightforward but the
>> > resulting code is not very Scala-ish. I wrote a little bit about it
>> > here:http://theikester.wordpress.com/2010/04/07/access-cassandra-from-scal....
>>
>> > I also considered wrapping it in Scala but, given Cassandra's and
>> > Hector's fast dev pace, that would introduce yet another moving target
>> > to maintain. Then there's the question about what "the right" API
>>
>> Then it is probably better to wait. What we have is working ok.
>>
>>
>>
>>
>>
>> > should be Scala. Viktor had:
>>
>> > // session => session | (key, new ColumnPath("Standard1", null,
>> > column1))
>>
>> > which borrows from the Thrift API. Scalandra does:
>>
>> > // cassandra.ColumnFamily("Standard1")("key")("column1")
>>
>> > which looks pretty clean, but I couldn't get it to work with the
>> > latest version of Cassandra. And then there's the new kid on the block
>> > Cascal which does:
>>
>> > // session.get("Test" \ "Standard1" \ "key" \ "column1")
>>
>> > Any thoughts from the more Scala savvy among us? I'm not a fan of the
>> > back-slash character as separator but not sure that argument
>>
>> I actually like the backslash, make it very easy to understand.
>> Navigate like a filesystem.
>>
>
> Yes, like an MS-DOS filesystem :) But kidding aside I agree. I like

/ is equally good to me

> For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.

Chris Shorrock

unread,
Apr 10, 2010, 12:54:45 PM4/10/10
to akka...@googlegroups.com
Hey guys - I'm the guy who wrote cascal. Just a few notes on the syntax - I really struggled with what to use when defining a path. A few considerations with what lead me to using "\":

* Originally I wanted to use "->", but I thought this may run into issue with already existing using of "->" to form a tuple, so I didn't want to overload that operator as it appeared to already be spoken for.
* I then thought about using "/". My only issue with this was within cascal when you do "Keyspace" \ "ColumnFamily", you also do "Keyspace" \\ "SuperCF" - using "//" wouldn't of worked as it would of commented out everything :) - I could of used something else to create a super column family, however I like the consistancy of "\"
* scala.xml.NodeSeq had already defined the use of "\" for traversal of nodes so I thought the analogy was somewhat similar - so it seemed like a logical choice.

Anyhow. My 2 cents on the issue when I was thinking on this.

Ike

unread,
Apr 10, 2010, 4:35:00 PM4/10/10
to Akka User List
On Apr 10, 12:54 pm, Chris Shorrock <chris.shorr...@gmail.com> wrote:
> Hey guys - I'm the guy who wrote cascal. Just a few notes on the syntax - I
> really struggled with what to use when defining a path. A few considerations
> with what lead me to using "\":
>
> * Originally I wanted to use "->", but I thought this may run into issue
> with already existing using of "->" to form a tuple, so I didn't want to
> overload that operator as it appeared to already be spoken for.
> * I then thought about using "/". My only issue with this was within cascal
> when you do "Keyspace" \ "ColumnFamily", you also do "Keyspace" \\ "SuperCF"
> - using "//" wouldn't of worked as it would of commented out everything :) -
> I could of used something else to create a super column family, however I
> like the consistancy of "\"
> * scala.xml.NodeSeq had already defined the use of "\" for traversal of
> nodes so I thought the analogy was somewhat similar - so it seemed like a
> logical choice.
>
> Anyhow. My 2 cents on the issue when I was thinking on this.

Thanks for your insights Chris. I haven't looked at your code yet but
I'm just curious: do you absolutely need a different delimiter for
supercolumns? Isn't there any other way to determine the kind of
Column Family we're dealing with? Like number of arguments, context,
etc. (i.e. if 1 token after the Key then StandardColumn , if 2 tokens
then SuperColumn)? Couldn't that be achieved with a simple overloaded
method signature or am I missing something?

For example:
session.get("Test" \ "Standard" \ "Key" \ "ColumnName") // standard
column family
session.get("Test" \ "Super" \ "Key" \ "SuperColumn" \
"ColumnName") // super column family

By the way, I think some of the stuff you're doing with the object
mapping is really practical. Perhaps we should continue this
discussion on the cascal list?

>
>
>
> On Fri, Apr 9, 2010 at 6:00 AM, Jonas Bonér <jo...@jonasboner.com> wrote:

> > akka-user+...@googlegroups.com<akka-user%2Bunsubscribe@googlegroups .com>


> > .
> > >> > For more options, visit this group athttp://
> > groups.google.com/group/akka-user?hl=en.
>
> > >> --
> > >> Jonas Bonér
>
> > >> work:  http://jayway.com
> > >> code:  http://akkasource.org
> > >> blog:    http://jonasboner.com
> > >> twitter: @jboner
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > "Akka User List" group.
> > > To post to this group, send email to akka...@googlegroups.com.
> > > To unsubscribe from this group, send email to

> > akka-user+...@googlegroups.com<akka-user%2Bunsubscribe@googlegroups .com>


> > .
> > > For more options, visit this group at
> >http://groups.google.com/group/akka-user?hl=en.
>
> > --
> > Jonas Bonér
>
> > work:  http://jayway.com
> > code:  http://akkasource.org
> > blog:    http://jonasboner.com
> > twitter: @jboner
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Akka User List" group.
> > To post to this group, send email to akka...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > akka-user+...@googlegroups.com<akka-user%2Bunsubscribe@googlegroups .com>

Chris Shorrock

unread,
Apr 10, 2010, 5:09:53 PM4/10/10
to akka...@googlegroups.com
Thanks for the feedback. So not to steer this into non-Akka related territory I've copied your questions over to http://github.com/shorrockin/cascal/issues/issue/8. Look forward to your feedback :)

To unsubscribe from this group, send email to akka-user+...@googlegroups.com.

Viktor Klang

unread,
Apr 22, 2010, 11:35:30 AM4/22/10
to akka...@googlegroups.com
Hey guys,

sorry for necroposting, but I found this and think it might be viable: http://github.com/cliffmoon/scromium

WDYT?
--
Viktor Klang
| "A complex system that works is invariably
| found to have evolved from a simple system
| that worked." - John Gall

Akka - the Actor Kernel: Akkasource.org
Twttr: twitter.com/viktorklang

Jonas Bonér

unread,
Apr 22, 2010, 11:42:03 AM4/22/10
to akka...@googlegroups.com

I like it. Do you like it better than yours ?

If someone feel urged to help out integrating it I would be most grateful.

On 22 Apr 2010 17:35, "Viktor Klang" <viktor...@gmail.com> wrote:

Hey guys,

sorry for necroposting, but I found this and think it might be viable: http://github.com/cliffmoon/scromium

WDYT?



On Sat, Apr 10, 2010 at 11:09 PM, Chris Shorrock <chris.s...@gmail.com> wrote:
>

> Thanks for ...

--

Viktor Klang
| "A complex system that works is invariably

| found to have evolved from a simple sys...

You received this message because you are subscribed to the Google Groups "Akka User List" group.

To...

Viktor Klang

unread,
Apr 22, 2010, 11:46:20 AM4/22/10
to akka...@googlegroups.com
On Thu, Apr 22, 2010 at 5:42 PM, Jonas Bonér <jo...@jonasboner.com> wrote:

I like it. Do you like it better than yours ?


Looks good. And also we don't need to maintain the code ourselves, which to me is a big plus.
 
I'll add it as a ticket in assembla.

| found to have evolved from a simple system
| that worked." - John Gall

Akka - the Actor Kernel: Akkasource.org
Twttr: twitter.com/viktorklang

Reply all
Reply to author
Forward
0 new messages