You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Michael Fortin <mi...@m410.us> on 2010/11/25 17:14:43 UTC

Updating Cascal

Hello,
I forked Cascal  (Scala based client for cassandra) and I'm attempting to update it to cassandra 0.7.  I have it partially working, but I'm getting stuck on a few areas.

I have most of the unit tests working from the original code, but I'm having an issue with batch_mutate(keyToFamilyMutations, consistency) .  Does the log output mean anything?  I can't figure out why the columns are not getting inserted.  If I change th code from a batch_mutate to an insert(family, parent, column, consistency) it works.

### keyToFamilyMutations: {java.nio.HeapByteBuffer[pos=0 lim=16 cap=16]={Standard=[Mutation(column_or_supercolumn:ColumnOrSuperColumn(column:Column(name:43 6F 6C 75 6D 6E 2D 61 2D 31, value:56 61 6C 75 65 2D 31, timestamp:1290662894466035))), Mutation(column_or_supercolumn:ColumnOrSuperColumn(column:Column(name:43 6F 6C 75 6D 6E 2D 61 2D 33, value:56 61 6C 75 65 2D 33, timestamp:1290662894467942))), Mutation(column_or_supercolumn:ColumnOrSuperColumn(column:Column(name:43 6F 6C 75 6D 6E 2D 61 2D 32, value:56 61 6C 75 65 2D 32, timestamp:1290662894467915)))]}}
DEBUG 2010-11-25 00:28:14,534 [org.apache.cassandra.thrift.CassandraServer pool-1-thread-2] batch_mutate
DEBUG 2010-11-25 00:28:14,583 [org.apache.cassandra.service.StorageProxy pool-1-thread-2] insert writing local RowMutation(keyspace='Test', key='ccfd5520f85411df858a001c42000009', modifications=[Standard])

DEBUG 2010-11-25 00:28:14,599 [org.apache.cassandra.thrift.CassandraServer pool-1-thread-2] get_slice
DEBUG 2010-11-25 00:28:14,605 [org.apache.cassandra.service.StorageProxy pool-1-thread-2] weakread reading SliceFromReadCommand(table='Test', key='5374616e64617264', column_parent='QueryPath(columnFamilyName='Standard', superColumnName='null', columnName='null')', start='', finish='', reversed=false, count=2147483647) locally
DEBUG 2010-11-25 00:28:14,608 [org.apache.cassandra.service.StorageProxy ReadStage:2] weakreadlocal reading SliceFromReadCommand(table='Test', key='5374616e64617264', column_parent='QueryPath(columnFamilyName='Standard', superColumnName='null', columnName='null')', start='', finish='', reversed=false, count=2147483647)
### get_slice: []


The code looks like:
      println("keyToFamilyMutations: %s".format(keyToFamilyMutations))
      client.batch_mutate(keyToFamilyMutations, consistency)
      …
      client.client.get_slice(…)

keyspaces:
    - name: Test
      replica_placement_strategy: org.apache.cassandra.locator.SimpleStrategy
      replication_factor: 1
      column_families:
        - {name: Standard, compare_with: BytesType}



Thanks,
Mike

Re: Updating Cascal

Posted by Daniel Lundin <dl...@eintr.org>.
I'd highly recommend looking at Hector (v2) as well. It's very nice.
I'm using it from Scala without any issues.

Rather than duplicating the effort of scromium, cascal, scalandra, and
not to mention Hector itself, perhaps it'd worthwhile taking a stab at
a Scala interface wrapping Hector?

Connection/failover strategies, test helpers and client metrics aren't
THAT much fun reinventing.

/d

> On Nov 30, 2010, at 9:51 AM, Jonathan Ellis wrote:
>
>> Did you look at Scromium?
>>
>> On Tue, Nov 30, 2010 at 8:27 AM, Michael Fortin <mi...@m410.us> wrote:
>>> Hi Tyler,
>>> Thanks for the response.  I decided to give up on it, and start my own Scala
>>> based api modeled on Cascal since it's no longer supported.

Re: Updating Cascal

Posted by Michael Fortin <mi...@m410.us>.
Your referring to this: https://github.com/cliffmoon/scromium right?  Thanks for the tip, I'll give it a try.

_Mike


On Nov 30, 2010, at 9:51 AM, Jonathan Ellis wrote:

> Did you look at Scromium?
> 
> On Tue, Nov 30, 2010 at 8:27 AM, Michael Fortin <mi...@m410.us> wrote:
>> Hi Tyler,
>> Thanks for the response.  I decided to give up on it, and start my own Scala
>> based api modeled on Cascal since it's no longer supported.
>> _M!ke
>> On Nov 30, 2010, at 1:06 AM, Tyler Hobbs wrote:
>> 
>> Are you sure you're using the same key for batch_mutate() and get_slice()?
>> They appear different in the logs.
>> 
>> - Tyler
>> 
>> On Thu, Nov 25, 2010 at 10:14 AM, Michael Fortin <mi...@m410.us> wrote:
>>> 
>>> Hello,
>>> I forked Cascal  (Scala based client for cassandra) and I'm attempting to
>>> update it to cassandra 0.7.  I have it partially working, but I'm getting
>>> stuck on a few areas.
>>> 
>>> I have most of the unit tests working from the original code, but I'm
>>> having an issue with batch_mutate(keyToFamilyMutations, consistency) .  Does
>>> the log output mean anything?  I can't figure out why the columns are not
>>> getting inserted.  If I change th code from a batch_mutate to an
>>> insert(family, parent, column, consistency) it works.
>>> 
>>> ### keyToFamilyMutations: {java.nio.HeapByteBuffer[pos=0 lim=16
>>> cap=16]={Standard=[Mutation(column_or_supercolumn:ColumnOrSuperColumn(column:Column(name:43
>>> 6F 6C 75 6D 6E 2D 61 2D 31, value:56 61 6C 75 65 2D 31,
>>> timestamp:1290662894466035))),
>>> Mutation(column_or_supercolumn:ColumnOrSuperColumn(column:Column(name:43 6F
>>> 6C 75 6D 6E 2D 61 2D 33, value:56 61 6C 75 65 2D 33,
>>> timestamp:1290662894467942))),
>>> Mutation(column_or_supercolumn:ColumnOrSuperColumn(column:Column(name:43 6F
>>> 6C 75 6D 6E 2D 61 2D 32, value:56 61 6C 75 65 2D 32,
>>> timestamp:1290662894467915)))]}}
>>> DEBUG 2010-11-25 00:28:14,534 [org.apache.cassandra.thrift.CassandraServer
>>> pool-1-thread-2] batch_mutate
>>> DEBUG 2010-11-25 00:28:14,583 [org.apache.cassandra.service.StorageProxy
>>> pool-1-thread-2] insert writing local RowMutation(keyspace='Test',
>>> key='ccfd5520f85411df858a001c42000009', modifications=[Standard])
>>> 
>>> DEBUG 2010-11-25 00:28:14,599 [org.apache.cassandra.thrift.CassandraServer
>>> pool-1-thread-2] get_slice
>>> DEBUG 2010-11-25 00:28:14,605 [org.apache.cassandra.service.StorageProxy
>>> pool-1-thread-2] weakread reading SliceFromReadCommand(table='Test',
>>> key='5374616e64617264',
>>> column_parent='QueryPath(columnFamilyName='Standard',
>>> superColumnName='null', columnName='null')', start='', finish='',
>>> reversed=false, count=2147483647) locally
>>> DEBUG 2010-11-25 00:28:14,608 [org.apache.cassandra.service.StorageProxy
>>> ReadStage:2] weakreadlocal reading SliceFromReadCommand(table='Test',
>>> key='5374616e64617264',
>>> column_parent='QueryPath(columnFamilyName='Standard',
>>> superColumnName='null', columnName='null')', start='', finish='',
>>> reversed=false, count=2147483647)
>>> ### get_slice: []
>>> 
>>> 
>>> The code looks like:
>>>      println("keyToFamilyMutations: %s".format(keyToFamilyMutations))
>>>      client.batch_mutate(keyToFamilyMutations, consistency)
>>>      …
>>>      client.client.get_slice(…)
>>> 
>>> keyspaces:
>>>    - name: Test
>>>      replica_placement_strategy:
>>> org.apache.cassandra.locator.SimpleStrategy
>>>      replication_factor: 1
>>>      column_families:
>>>        - {name: Standard, compare_with: BytesType}
>>> 
>>> 
>>> 
>>> Thanks,
>>> Mike
>> 
>> 
> 
> 
> 
> -- 
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com


Re: Updating Cascal

Posted by Jonathan Ellis <jb...@gmail.com>.
Did you look at Scromium?

On Tue, Nov 30, 2010 at 8:27 AM, Michael Fortin <mi...@m410.us> wrote:
> Hi Tyler,
> Thanks for the response.  I decided to give up on it, and start my own Scala
> based api modeled on Cascal since it's no longer supported.
> _M!ke
> On Nov 30, 2010, at 1:06 AM, Tyler Hobbs wrote:
>
> Are you sure you're using the same key for batch_mutate() and get_slice()?
> They appear different in the logs.
>
> - Tyler
>
> On Thu, Nov 25, 2010 at 10:14 AM, Michael Fortin <mi...@m410.us> wrote:
>>
>> Hello,
>> I forked Cascal  (Scala based client for cassandra) and I'm attempting to
>> update it to cassandra 0.7.  I have it partially working, but I'm getting
>> stuck on a few areas.
>>
>> I have most of the unit tests working from the original code, but I'm
>> having an issue with batch_mutate(keyToFamilyMutations, consistency) .  Does
>> the log output mean anything?  I can't figure out why the columns are not
>> getting inserted.  If I change th code from a batch_mutate to an
>> insert(family, parent, column, consistency) it works.
>>
>> ### keyToFamilyMutations: {java.nio.HeapByteBuffer[pos=0 lim=16
>> cap=16]={Standard=[Mutation(column_or_supercolumn:ColumnOrSuperColumn(column:Column(name:43
>> 6F 6C 75 6D 6E 2D 61 2D 31, value:56 61 6C 75 65 2D 31,
>> timestamp:1290662894466035))),
>> Mutation(column_or_supercolumn:ColumnOrSuperColumn(column:Column(name:43 6F
>> 6C 75 6D 6E 2D 61 2D 33, value:56 61 6C 75 65 2D 33,
>> timestamp:1290662894467942))),
>> Mutation(column_or_supercolumn:ColumnOrSuperColumn(column:Column(name:43 6F
>> 6C 75 6D 6E 2D 61 2D 32, value:56 61 6C 75 65 2D 32,
>> timestamp:1290662894467915)))]}}
>> DEBUG 2010-11-25 00:28:14,534 [org.apache.cassandra.thrift.CassandraServer
>> pool-1-thread-2] batch_mutate
>> DEBUG 2010-11-25 00:28:14,583 [org.apache.cassandra.service.StorageProxy
>> pool-1-thread-2] insert writing local RowMutation(keyspace='Test',
>> key='ccfd5520f85411df858a001c42000009', modifications=[Standard])
>>
>> DEBUG 2010-11-25 00:28:14,599 [org.apache.cassandra.thrift.CassandraServer
>> pool-1-thread-2] get_slice
>> DEBUG 2010-11-25 00:28:14,605 [org.apache.cassandra.service.StorageProxy
>> pool-1-thread-2] weakread reading SliceFromReadCommand(table='Test',
>> key='5374616e64617264',
>> column_parent='QueryPath(columnFamilyName='Standard',
>> superColumnName='null', columnName='null')', start='', finish='',
>> reversed=false, count=2147483647) locally
>> DEBUG 2010-11-25 00:28:14,608 [org.apache.cassandra.service.StorageProxy
>> ReadStage:2] weakreadlocal reading SliceFromReadCommand(table='Test',
>> key='5374616e64617264',
>> column_parent='QueryPath(columnFamilyName='Standard',
>> superColumnName='null', columnName='null')', start='', finish='',
>> reversed=false, count=2147483647)
>> ### get_slice: []
>>
>>
>> The code looks like:
>>      println("keyToFamilyMutations: %s".format(keyToFamilyMutations))
>>      client.batch_mutate(keyToFamilyMutations, consistency)
>>      …
>>      client.client.get_slice(…)
>>
>> keyspaces:
>>    - name: Test
>>      replica_placement_strategy:
>> org.apache.cassandra.locator.SimpleStrategy
>>      replication_factor: 1
>>      column_families:
>>        - {name: Standard, compare_with: BytesType}
>>
>>
>>
>> Thanks,
>> Mike
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Re: Updating Cascal

Posted by Michael Fortin <mi...@m410.us>.
Hi Tyler,

Thanks for the response.  I decided to give up on it, and start my own Scala based api modeled on Cascal since it's no longer supported. 

_M!ke

On Nov 30, 2010, at 1:06 AM, Tyler Hobbs wrote:

> Are you sure you're using the same key for batch_mutate() and get_slice()?  They appear different in the logs.
> 
> - Tyler
> 
> On Thu, Nov 25, 2010 at 10:14 AM, Michael Fortin <mi...@m410.us> wrote:
> Hello,
> I forked Cascal  (Scala based client for cassandra) and I'm attempting to update it to cassandra 0.7.  I have it partially working, but I'm getting stuck on a few areas.
> 
> I have most of the unit tests working from the original code, but I'm having an issue with batch_mutate(keyToFamilyMutations, consistency) .  Does the log output mean anything?  I can't figure out why the columns are not getting inserted.  If I change th code from a batch_mutate to an insert(family, parent, column, consistency) it works.
> 
> ### keyToFamilyMutations: {java.nio.HeapByteBuffer[pos=0 lim=16 cap=16]={Standard=[Mutation(column_or_supercolumn:ColumnOrSuperColumn(column:Column(name:43 6F 6C 75 6D 6E 2D 61 2D 31, value:56 61 6C 75 65 2D 31, timestamp:1290662894466035))), Mutation(column_or_supercolumn:ColumnOrSuperColumn(column:Column(name:43 6F 6C 75 6D 6E 2D 61 2D 33, value:56 61 6C 75 65 2D 33, timestamp:1290662894467942))), Mutation(column_or_supercolumn:ColumnOrSuperColumn(column:Column(name:43 6F 6C 75 6D 6E 2D 61 2D 32, value:56 61 6C 75 65 2D 32, timestamp:1290662894467915)))]}}
> DEBUG 2010-11-25 00:28:14,534 [org.apache.cassandra.thrift.CassandraServer pool-1-thread-2] batch_mutate
> DEBUG 2010-11-25 00:28:14,583 [org.apache.cassandra.service.StorageProxy pool-1-thread-2] insert writing local RowMutation(keyspace='Test', key='ccfd5520f85411df858a001c42000009', modifications=[Standard])
> 
> DEBUG 2010-11-25 00:28:14,599 [org.apache.cassandra.thrift.CassandraServer pool-1-thread-2] get_slice
> DEBUG 2010-11-25 00:28:14,605 [org.apache.cassandra.service.StorageProxy pool-1-thread-2] weakread reading SliceFromReadCommand(table='Test', key='5374616e64617264', column_parent='QueryPath(columnFamilyName='Standard', superColumnName='null', columnName='null')', start='', finish='', reversed=false, count=2147483647) locally
> DEBUG 2010-11-25 00:28:14,608 [org.apache.cassandra.service.StorageProxy ReadStage:2] weakreadlocal reading SliceFromReadCommand(table='Test', key='5374616e64617264', column_parent='QueryPath(columnFamilyName='Standard', superColumnName='null', columnName='null')', start='', finish='', reversed=false, count=2147483647)
> ### get_slice: []
> 
> 
> The code looks like:
>      println("keyToFamilyMutations: %s".format(keyToFamilyMutations))
>      client.batch_mutate(keyToFamilyMutations, consistency)
>      …
>      client.client.get_slice(…)
> 
> keyspaces:
>    - name: Test
>      replica_placement_strategy: org.apache.cassandra.locator.SimpleStrategy
>      replication_factor: 1
>      column_families:
>        - {name: Standard, compare_with: BytesType}
> 
> 
> 
> Thanks,
> Mike
> 


Re: Updating Cascal

Posted by Tyler Hobbs <ty...@riptano.com>.
Are you sure you're using the same key for batch_mutate() and get_slice()?
They appear different in the logs.

- Tyler

On Thu, Nov 25, 2010 at 10:14 AM, Michael Fortin <mi...@m410.us> wrote:

> Hello,
> I forked Cascal  (Scala based client for cassandra) and I'm attempting to
> update it to cassandra 0.7.  I have it partially working, but I'm getting
> stuck on a few areas.
>
> I have most of the unit tests working from the original code, but I'm
> having an issue with batch_mutate(keyToFamilyMutations, consistency) .  Does
> the log output mean anything?  I can't figure out why the columns are not
> getting inserted.  If I change th code from a batch_mutate to an
> insert(family, parent, column, consistency) it works.
>
> ### keyToFamilyMutations: {java.nio.HeapByteBuffer[pos=0 lim=16
> cap=16]={Standard=[Mutation(column_or_supercolumn:ColumnOrSuperColumn(column:Column(name:43
> 6F 6C 75 6D 6E 2D 61 2D 31, value:56 61 6C 75 65 2D 31,
> timestamp:1290662894466035))),
> Mutation(column_or_supercolumn:ColumnOrSuperColumn(column:Column(name:43 6F
> 6C 75 6D 6E 2D 61 2D 33, value:56 61 6C 75 65 2D 33,
> timestamp:1290662894467942))),
> Mutation(column_or_supercolumn:ColumnOrSuperColumn(column:Column(name:43 6F
> 6C 75 6D 6E 2D 61 2D 32, value:56 61 6C 75 65 2D 32,
> timestamp:1290662894467915)))]}}
> DEBUG 2010-11-25 00:28:14,534 [org.apache.cassandra.thrift.CassandraServer
> pool-1-thread-2] batch_mutate
> DEBUG 2010-11-25 00:28:14,583 [org.apache.cassandra.service.StorageProxy
> pool-1-thread-2] insert writing local RowMutation(keyspace='Test',
> key='ccfd5520f85411df858a001c42000009', modifications=[Standard])
>
> DEBUG 2010-11-25 00:28:14,599 [org.apache.cassandra.thrift.CassandraServer
> pool-1-thread-2] get_slice
> DEBUG 2010-11-25 00:28:14,605 [org.apache.cassandra.service.StorageProxy
> pool-1-thread-2] weakread reading SliceFromReadCommand(table='Test',
> key='5374616e64617264',
> column_parent='QueryPath(columnFamilyName='Standard',
> superColumnName='null', columnName='null')', start='', finish='',
> reversed=false, count=2147483647) locally
> DEBUG 2010-11-25 00:28:14,608 [org.apache.cassandra.service.StorageProxy
> ReadStage:2] weakreadlocal reading SliceFromReadCommand(table='Test',
> key='5374616e64617264',
> column_parent='QueryPath(columnFamilyName='Standard',
> superColumnName='null', columnName='null')', start='', finish='',
> reversed=false, count=2147483647)
> ### get_slice: []
>
>
> The code looks like:
>      println("keyToFamilyMutations: %s".format(keyToFamilyMutations))
>      client.batch_mutate(keyToFamilyMutations, consistency)
>      …
>      client.client.get_slice(…)
>
> keyspaces:
>    - name: Test
>      replica_placement_strategy:
> org.apache.cassandra.locator.SimpleStrategy
>      replication_factor: 1
>      column_families:
>        - {name: Standard, compare_with: BytesType}
>
>
>
> Thanks,
> Mike