newbie trying to work lazyboy lib

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

newbie trying to work lazyboy lib

Ben Eliott
Hi,
I'm still in the WTF stage of cassandra, trying out the lazyboy python  
lib. I'm getting back this error when i try and run the record.py  
example

 >>> from test1 import record
{'column_family': 'Users', 'keyspace': 'UserData', 'super_column':  
None, 'key': 'd074db72b7a045978e8f0ba048907767'}
User: {'username': 'ieure', 'email': '[hidden email]'}
True
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/Users/beneliott/Projects/TornadoSites/test/test1/record.py",  
line 77, in <module>
     u.save()           # -> {'username': 'ieure', 'email': '[hidden email]
'}
   File "/Users/beneliott/Code/py-packages/tornado-dev/lib/python2.5/
site-packages/lazyboy/record.py", line 164, in save
     client.batch_insert(*self._get_batch_args(self.key, changed))
   File "/Users/beneliott/Code/py-packages/tornado-dev/lib/python2.5/
site-packages/lazyboy/connection.py", line 106, in func
     raise ErrorThriftMessage(message)
lazyboy.exceptions.ErrorThriftMessage: Invalid method name:  
'batch_insert'


Looking at the save method in the Record object I can see that the  
object called 'client' returned by_get_cas doesn't have a batch_insert  
method... which is probably what's throwing the exception:


client = self._get_cas()

(deleted, changed) = self._marshal().values()

for path in deleted:
        client.remove(self.key.keyspace, self.key.key, path,
                     self.timestamp(), ConsistencyLevel.ONE)

if changed:
        client.batch_insert(*self._get_batch_args(self.key, changed))



However, the object which is returned by self._get_cas() though does  
have a method _get_server(). If I call this  then it does return  
another object which does have batch_insert method.

Maybe somehow self._get_cas() is returning the wrong object somehow.  
Maybe i need to tweak a setting?

Any advice would be great.

Thanks,

Ben




Reply | Threaded
Open this post in threaded view
|

Re: newbie trying to work lazyboy lib

Curt Micol
On Fri, Sep 18, 2009 at 8:07 AM, Ben Eliott
<[hidden email]> wrote:

> Hi,
> I'm still in the WTF stage of cassandra, trying out the lazyboy python lib.
> I'm getting back this error when i try and run the record.py example
>
>>>> from test1 import record
> {'column_family': 'Users', 'keyspace': 'UserData', 'super_column': None,
> 'key': 'd074db72b7a045978e8f0ba048907767'}
> User: {'username': 'ieure', 'email': '[hidden email]'}
> True
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/Users/beneliott/Projects/TornadoSites/test/test1/record.py", line
> 77, in <module>
>    u.save()           # -> {'username': 'ieure', 'email': '[hidden email]'}
>  File
> "/Users/beneliott/Code/py-packages/tornado-dev/lib/python2.5/site-packages/lazyboy/record.py",
> line 164, in save
>    client.batch_insert(*self._get_batch_args(self.key, changed))
>  File
> "/Users/beneliott/Code/py-packages/tornado-dev/lib/python2.5/site-packages/lazyboy/connection.py",
> line 106, in func
>    raise ErrorThriftMessage(message)
> lazyboy.exceptions.ErrorThriftMessage: Invalid method name: 'batch_insert'

I've seen this issue a couple times now on IRC, and I believe that you
are using 0.3 when you should be using Cassandra 0.4.  Make sure you
regen your thrift bindings also.

--
# Curt Micol
Reply | Threaded
Open this post in threaded view
|

Re: newbie trying to work lazyboy lib

Ben Eliott
Hi,
Thank-you for your email. I am getting some advice on the IRC to help  
out with this. Same advice - change version reinstall. Trying now. NOt  
going too well, will stick at it a while longer before coming back.
Ben

On 18 Sep 2009, at 15:00, Curt Micol wrote:

> On Fri, Sep 18, 2009 at 8:07 AM, Ben Eliott
> <[hidden email]> wrote:
>> Hi,
>> I'm still in the WTF stage of cassandra, trying out the lazyboy  
>> python lib.
>> I'm getting back this error when i try and run the record.py example
>>
>>>>> from test1 import record
>> {'column_family': 'Users', 'keyspace': 'UserData', 'super_column':  
>> None,
>> 'key': 'd074db72b7a045978e8f0ba048907767'}
>> User: {'username': 'ieure', 'email': '[hidden email]'}
>> True
>> Traceback (most recent call last):
>>  File "<stdin>", line 1, in <module>
>>  File "/Users/beneliott/Projects/TornadoSites/test/test1/
>> record.py", line
>> 77, in <module>
>>    u.save()           # -> {'username': 'ieure', 'email': '[hidden email]
>> '}
>>  File
>> "/Users/beneliott/Code/py-packages/tornado-dev/lib/python2.5/site-
>> packages/lazyboy/record.py",
>> line 164, in save
>>    client.batch_insert(*self._get_batch_args(self.key, changed))
>>  File
>> "/Users/beneliott/Code/py-packages/tornado-dev/lib/python2.5/site-
>> packages/lazyboy/connection.py",
>> line 106, in func
>>    raise ErrorThriftMessage(message)
>> lazyboy.exceptions.ErrorThriftMessage: Invalid method name:  
>> 'batch_insert'
>
> I've seen this issue a couple times now on IRC, and I believe that you
> are using 0.3 when you should be using Cassandra 0.4.  Make sure you
> regen your thrift bindings also.
>
> --
> # Curt Micol