carloscm/gossie

Example of constructing a row

Closed this issue · 3 comments

I'm trying to mutate into C* something quite simple. I have a row key, a column name and a value. Each of these is just a string (I generally use the BytesType comparator).

My question is how I would achieve this using Gossie. I have spent a while messing around with it and I think there is something I'm not understanding; possibly around exactly how I should marshal my data into the structure required to do:

err = pool.Writer().Insert("MyColumnFamily", row).Run()

I'm trying to use what you describe as the "low level API" since my data does not really fit the entity-like model that is described later on (your Twitter example).

To be clearer about what I'm doing, here's a Gist with some code, and here's a Gist with the resulting error when I run the application.

I fail to see anything obviously wrong with your code. Can you please also error check the gossie.NewConnectionPool call, instead of ignoring the returned error? It could be that pool is nil. Maybe you are trying to connect to an invalid server, or you are using invalid options for your server.

Thanks for the help. You're correct. An [updated Gist[(https://gist.github.com/4690524) now does something sensible!

It might be worth tweaking the docs (see my pull request).