Return-Path: Delivered-To: apmail-incubator-cassandra-user-archive@minotaur.apache.org Received: (qmail 63411 invoked from network); 24 Aug 2009 23:36:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Aug 2009 23:36:02 -0000 Received: (qmail 48069 invoked by uid 500); 24 Aug 2009 23:36:27 -0000 Delivered-To: apmail-incubator-cassandra-user-archive@incubator.apache.org Received: (qmail 48034 invoked by uid 500); 24 Aug 2009 23:36:27 -0000 Mailing-List: contact cassandra-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cassandra-user@incubator.apache.org Delivered-To: mailing list cassandra-user@incubator.apache.org Received: (qmail 48025 invoked by uid 99); 24 Aug 2009 23:36:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Aug 2009 23:36:27 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of bcouto@gmail.com designates 209.85.217.221 as permitted sender) Received: from [209.85.217.221] (HELO mail-gx0-f221.google.com) (209.85.217.221) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Aug 2009 23:36:16 +0000 Received: by gxk21 with SMTP id 21so3729491gxk.3 for ; Mon, 24 Aug 2009 16:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=oSNPqbx9EYzUJbqNbLkod7cw3WiNEWxuS9U9ZVfSrhc=; b=p/zInh0JtLyi2OxDT/3PSE7x332F0VO+cxEN218wVsUNWofbRWi2+HH53pDDyntZhg oXbzm6/z+6rnC/dww3NMFyTiaTCF8Ywo6cApjXImTtEav9N63r/4PkKVOZ/7GCU1DvbE lj+bgEdVnfBm+PobchlqssCOzVr+hqH4jU5AY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=coHcA63QIeCiVvGqTwJbW8jRxtutGXfAkpzzxm7hHxbgDhKKkRR1sxJQxlZ+yPeemO +6gKvuvo/Wj5uYg4iMqRbtOJlNZQIJTvT8O/Le/ioBv6OcrgyRM11rrA0RajRvK0nY11 0P/O22NJ2EK5JSQ5yxHU/AXai9HbA+TnN2zXM= MIME-Version: 1.0 Received: by 10.150.45.15 with SMTP id s15mr9228880ybs.107.1251156955751; Mon, 24 Aug 2009 16:35:55 -0700 (PDT) In-Reply-To: References: Date: Mon, 24 Aug 2009 20:35:55 -0300 Message-ID: Subject: =?ISO-8859-1?Q?Re=3A_Newbe=B4s_question?= From: Bruno Couto To: cassandra-user@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Drew, As I said earlier, I am in my first steps with Cassandra, but I will use your branch and notify my experiences. Thanks, Bruno Couto. On Mon, Aug 24, 2009 at 7:15 PM, Drew Schleck wrote= : > I've been working on a Lazyboy 0.4 update at > http://github.com/dschleck/lazyboy/ . Right now it's at the point > where it works for me and what I'm doing but there's probably a few > bugs to be caught. As an example, yesterday I noticed it wasn't > possible to delete items out of supercolumns so I fixed that. > > If you decide to use my branch of it and find a bug, please tell me > about it and I'll do my best to sort it out. > > Drew > > On Mon, Aug 24, 2009 at 12:09, Evan Weaver wrote: >> The Ruby client works fine. ;-) >> >> Evan >> >> On Mon, Aug 24, 2009 at 12:00 PM, Jonathan Ellis wrot= e: >>> That's probably the best option at the moment. =A0Once you're familiar >>> with the thrift API I'm sure the lazyboy devs would welcome updates >>> too. >>> >>> -Jonathan >>> >>> On Mon, Aug 24, 2009 at 1:54 PM, Bruno Couto wrote: >>>> Thanks for helpping me Jonathan! >>>> >>>> Well, now I know that I can=B4t use the Lazyboy, then I will try my >>>> first steps using the Cassandra trunk version and thrift api whitout a >>>> wrapper. >>>> >>>> >>>> On Mon, Aug 24, 2009 at 2:41 PM, Jonathan Ellis wro= te: >>>>> lazyboy works vs an earlier version of trunk, so it's already >>>>> incompatible with 0.3, but not yet compatible w/ latest 0.4 :) >>>>> >>>>> On Mon, Aug 24, 2009 at 12:28 PM, Bruno Couto wrote= : >>>>>> Jonathan, >>>>>> >>>>>> >>>>>> First, thanks for answering so fast. >>>>>> I=B4m using version 0.3-final of Cassandra, then I believe the api >>>>>> version 0.4 is not the problem, am I correct? >>>>>> I'll look for the null problem. >>>>>> >>>>>> >>>>>> Bruno Couto >>>>>> >>>>>> >>>>>> On Mon, Aug 24, 2009 at 11:50 AM, Jonathan Ellis = wrote: >>>>>>> There's two things going on here, I think. >>>>>>> >>>>>>> One is that you're passing a null where there shouldn't be one. =A0= This >>>>>>> is a thrift bug and will be addressed in the next beta. >>>>>>> >>>>>>> The other is that IIRC lazyboy needs to be updated to work with the >>>>>>> latest 0.4 api. >>>>>>> >>>>>>> -Jonathan >>>>>>> >>>>>>> On Mon, Aug 24, 2009 at 9:09 AM, Bruno Couto wrot= e: >>>>>>>> Hi Guys, >>>>>>>> >>>>>>>> my name is Bruno and I'm from Brazil, first, sorry for my bad engl= ish. >>>>>>>> I'm in my first steps with cassandra, and I=B4m trying to use Lazy= boy >>>>>>>> (python wrapper). >>>>>>>> But when I run the layzyboy columnfamily.py example, I get the >>>>>>>> following error messages. >>>>>>>> Someone with more experience could help me? >>>>>>>> >>>>>>>> Thanks, >>>>>>>> >>>>>>>> Bruno Couto. >>>>>>>> >>>>>>>> >>>>>>>> ---- >>>>>>>> >>>>>>>> Cassandra Error Message: >>>>>>>> >>>>>>>> DEBUG - batch_insert >>>>>>>> ERROR - Internal error processing batch_insert >>>>>>>> java.lang.NullPointerException >>>>>>>> =A0 =A0 =A0 =A0at org.apache.cassandra.db.RowMutation.getRowMutati= on(RowMutation.java:284) >>>>>>>> =A0 =A0 =A0 =A0at org.apache.cassandra.service.CassandraServer.bat= ch_insert(CassandraServer.java:318) >>>>>>>> =A0 =A0 =A0 =A0at org.apache.cassandra.service.Cassandra$Processor= $batch_insert.process(Cassandra.java:968) >>>>>>>> =A0 =A0 =A0 =A0at org.apache.cassandra.service.Cassandra$Processor= .process(Cassandra.java:807) >>>>>>>> =A0 =A0 =A0 =A0at org.apache.thrift.server.TThreadPoolServer$Worke= rProcess.run(TThreadPoolServer.java:252) >>>>>>>> =A0 =A0 =A0 =A0at java.util.concurrent.ThreadPoolExecutor$Worker.r= unTask(ThreadPoolExecutor.java:886) >>>>>>>> =A0 =A0 =A0 =A0at java.util.concurrent.ThreadPoolExecutor$Worker.r= un(ThreadPoolExecutor.java:908) >>>>>>>> =A0 =A0 =A0 =A0at java.lang.Thread.run(Thread.java:619) >>>>>>>> DEBUG - Disseminating load info ... >>>>>>>> >>>>>>>> ---- >>>>>>>> >>>>>>>> Python Error Message: >>>>>>>> >>>>>>>> localhost ~ # python columnfamily.py >>>>>>>> {'table': 'UserData', 'superkey': None, 'key': >>>>>>>> '3a63b82a947d4ee1a8cbee45944b5dcb', 'family': 'Users', 'supercol': >>>>>>>> None} >>>>>>>> {'username': 'ieure', 'email': 'ian@digg.com'} >>>>>>>> True >>>>>>>> Traceback (most recent call last): >>>>>>>> =A0File "columnfamily.py", line 65, in >>>>>>>> =A0 =A0u.save() =A0 =A0 =A0 =A0 =A0 # -> {'username': 'ieure', 'em= ail': 'ian@digg.com'} >>>>>>>> =A0File "/root/columnfamily.py", line 119, in save >>>>>>>> >>>>>>>> =A0File "build/bdist.linux-i686/egg/lazyboy/connection.py", line 1= 06, in func >>>>>>>> lazyboy.exceptions.ErrorThriftMessage: Internal error processing b= atch_insert >>>>>>>> >>>>>>>> ---- >>>>>>>> >>>>>>>> ColumnFamily.py >>>>>>>> >>>>>>>> # -*- coding: utf-8 -*- >>>>>>>> # >>>>>>>> # Lazyboy examples >>>>>>>> # >>>>>>>> # =A9 2009 Digg, Inc. All rights reserved. >>>>>>>> # Author: Ian Eure >>>>>>>> # >>>>>>>> # This example assumes the following schema: >>>>>>>> # >>>>>>>> # >>>>>>>> # =A0 =A0 >>>>>>>> # =A0 =A0 =A0 =A0 >>>>>>>> # =A0 =A0
>>>>>>>> #
>>>>>>>> # >>>>>>>> >>>>>>>> >>>>>>>> from lazyboy import * >>>>>>>> >>>>>>>> >>>>>>>> # Define your cluster(s) >>>>>>>> connection.add_pool('UserData', ['localhost:9160']) >>>>>>>> >>>>>>>> >>>>>>>> # Subclass ColumnFamily to create an object of the correct type. >>>>>>>> class User(columnfamily.ColumnFamily): >>>>>>>> =A0 =A0"""A class representing a user in Cassandra.""" >>>>>>>> >>>>>>>> =A0 =A0# _key is the key template. It's values are given to >>>>>>>> =A0 =A0# PrimaryKey.__init__ as keyword arguments any time a PK is >>>>>>>> =A0 =A0# instantiated for this object. >>>>>>>> =A0 =A0_key =3D {'table': 'UserData', =A0 =A0 =A0 =A0# The table t= o store in >>>>>>>> =A0 =A0 =A0 =A0 =A0 =A0'family': 'Users'} =A0 =A0 =A0 =A0 =A0# The= ColumnFamily name to store on >>>>>>>> >>>>>>>> =A0 =A0# Anything in here _must_ be set before the object is saved >>>>>>>> =A0 =A0_required =3D ('username',) >>>>>>>> >>>>>>>> >>>>>>>> # Create an empty object >>>>>>>> u =3D User() >>>>>>>> >>>>>>>> # A PrimaryKey is generated for you: >>>>>>>> print u.pk >>>>>>>> # -> {'table': 'UserData', 'superkey': None, >>>>>>>> # =A0 =A0 'key': 'da6c8e19174f40cfa6d0b65a08eef62f', >>>>>>>> # =A0 =A0 'family': 'Users', 'supercol': None} >>>>>>>> >>>>>>>> data =3D {'username': 'ieure', 'email': 'ian@digg.com'} >>>>>>>> >>>>>>>> # The object is a dict. All these are equivalent. >>>>>>>> u.update(data) >>>>>>>> u.update(data.items()) >>>>>>>> u.update(**data) >>>>>>>> for k in data: >>>>>>>> =A0 =A0u[k] =3D data[k] >>>>>>>> >>>>>>>> # Arguments to __init__ are passed to update() >>>>>>>> u =3D User(data) >>>>>>>> print u =A0 =A0 =A0 =A0 =A0 =A0# -> {'username': 'ieure', 'email':= 'ian@digg.com'} >>>>>>>> >>>>>>>> # You can see if it's been modified. >>>>>>>> print u.is_modified() =A0 =A0 =A0 =A0 =A0 # -> True >>>>>>>> >>>>>>>> # Save to Cassandra >>>>>>>> u.save() =A0 =A0 =A0 =A0 =A0 # -> {'username': 'ieure', 'email': '= ian@digg.com'} >>>>>>>> >>>>>>>> print u.is_modified() =A0 =A0 =A0 =A0 =A0 # -> False >>>>>>>> >>>>>>>> # Load it in a new instance. >>>>>>>> u_ =3D User().load(u.pk.key) >>>>>>>> print u_ =A0 =A0 =A0 =A0 =A0 # -> {'username': 'ieure', 'email': '= ian@digg.com'} >>>>>>>> >>>>>>>> print u.is_modified() =A0 =A0 =A0 =A0 =A0 # -> False >>>>>>>> del u['username'] >>>>>>>> print u.valid() =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # -> False >>>>>>>> print u.missing() =A0 =A0 =A0 =A0 =A0 =A0 =A0 # -> ('username',) >>>>>>>> try: >>>>>>>> =A0 =A0u.save() =A0 =A0 =A0 =A0# -> ('Missing required field(s):',= ('username',)) >>>>>>>> except Exception, e: >>>>>>>> =A0 =A0print e >>>>>>>> >>>>>>>> # Discard modifications >>>>>>>> u.revert() >>>>>>>> print u.is_modified() =A0 =A0 =A0 =A0 =A0 # -> False >>>>>>>> print u.valid() =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # -> True >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> >> >> >> -- >> Evan Weaver >> >