Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 78037 invoked from network); 14 Jul 2010 03:03:43 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Jul 2010 03:03:43 -0000 Received: (qmail 89206 invoked by uid 500); 14 Jul 2010 03:03:41 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 89047 invoked by uid 500); 14 Jul 2010 03:03:39 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 89035 invoked by uid 99); 14 Jul 2010 03:03:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jul 2010 03:03:38 +0000 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=FREEMAIL_FROM,HTML_FONT_FACE_BAD,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of daveviner@gmail.com designates 209.85.160.44 as permitted sender) Received: from [209.85.160.44] (HELO mail-pw0-f44.google.com) (209.85.160.44) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jul 2010 03:03:32 +0000 Received: by pwj1 with SMTP id 1so3059189pwj.31 for ; Tue, 13 Jul 2010 20:03:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=bJ4aNMigA14vSo0PJVRpJkHhgGAIwQ1LPxfiqC/CMvc=; b=WB0zvTK+CD8qNNad8QuJsobp9ZyILOamblwEcO307uR/jpzTxo3+gMwmw4LcXLWLRJ 2ptZ/M4Ta8+D9051K6MPmNaAfURDfhxCg69QV+Wb23rFT1kUMsFNDEL28VJKVzm4JYQL 3eYz9N9oeqkvQjU+ElDEwbbFzWgfHXTBZ5ij4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=AM3TJ0NzkHncKVYOXnu3ZOk1cjnGRUDS647UNy89LoYhZEcvKuAnoye1yU9PeRS48S F3JIc/BlrWL/ntTiIghqc9v0kBONgDLaGqC8yJQi15/SOK4uep6CYnNaCrHZrkTiHCAR ipRzlM8Qad07eM9a4C4AmpcLVrXPwiHaTa0QY= MIME-Version: 1.0 Received: by 10.142.237.12 with SMTP id k12mr20621865wfh.319.1279076588194; Tue, 13 Jul 2010 20:03:08 -0700 (PDT) Sender: daveviner@gmail.com Received: by 10.143.163.17 with HTTP; Tue, 13 Jul 2010 20:03:08 -0700 (PDT) In-Reply-To: References: <005e01cb2117$ed5b2910$c8117b30$@com> Date: Tue, 13 Jul 2010 20:03:08 -0700 X-Google-Sender-Auth: HbXVCZq06rhDczWkKAEJeWUbcMU Message-ID: Subject: Re: Is anyone using version 0.7 schema update API From: Dave Viner To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=000e0cd32ee6ae12cf048b50391f X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd32ee6ae12cf048b50391f Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Check out step 4 of this page: https://wiki.fourkitchens.com/display/PF/Using+Cassandra+with+PHP ./compiler/cpp/thrift -gen php ../PATH-TO-CASSANDRA/interface/cassandra.thrift That is how to compile the thrift client from the cassandra bindings. Just replace the "php" with the language of your choosing. According to http://wiki.apache.org/thrift/, "Thrift has generators for C++, C#, Erlang, Haskell, Java, Objective C/Cocoa, OCaml, Perl, PHP, Python, Ruby, and Squeak" HTH Dave Viner On Tue, Jul 13, 2010 at 6:05 PM, GH wrote: > > To be honest I do not know how to regenerate the binidings, I will look > into that. > ollowing your email, I went on and took the unit test code and created a > client. Given that this code works I am guessing that the thrift bindings > are in place and it is more that the client code does not support the new > functions yet. > I might be off track and don't know if there it is appropriate for someon= e > as new to this as I am to make changes to the client and submit them > (especially if some one else is already doing that). I could do that, if = it > helped the group. > > > > > > On Wed, Jul 14, 2010 at 2:12 AM, Benjamin Black wrote: > >> I updated the Ruby client to 0.7, but I am not a Cassandra committer >> (and not much of a Java guy), so haven't touched the Java client. Is >> there more to it than regenerating Thrift bindings? >> >> On Tue, Jul 13, 2010 at 1:42 AM, GH wrote: >> > They are not complicated, its more that they are not in the package th= at >> > they should be in. >> > I assume the client package exposes the functionality of the server an= d >> it >> > does not have the ability to manage the tables in the database that to >> me >> > seems to be extremely limiting. >> > When I did not see that code in place I assume that it is not complete >> or >> > that I have not got the right code drop. >> > From your commetns it sounds like you don't support the Java client co= de >> > base in line with the ruby code. Which I think is limiting but is just >> the >> > way it is. >> > >> > On Tue, Jul 13, 2010 at 8:53 AM, Benjamin Black wrote: >> >> >> >> I guess I don't understand what is so complicated about the schema >> >> management calls that numerous examples are needed. >> >> >> >> On Mon, Jul 12, 2010 at 4:43 AM, GH wrote: >> >> > Hi, >> >> > My problem is that I cannot locate Java equivalents to the api call= s >> you >> >> > present in the ruby files you have presented. They are not visible = in >> >> > the >> >> > java client packages I have (My code is not that old of trunk). >> >> > >> >> > I located the code below from some of the unit test code files.... >> This >> >> > code >> >> > will have to be refactored to create a test. >> >> > This is all I could find and it seems that there must be better >> client >> >> > examples than this. >> >> > >> >> > I expected to see client code in the org.apache.cassandra.cli >> package >> >> > but >> >> > there was nothing there. (I searched all of the code for calls to >> these >> >> > API's in the end) >> >> > Where should I be looking to get proper Java code samples ? >> >> > Regards >> >> > Gavan >> >> > >> >> > >> >> > Here is what I was about to refactor... >> >> > >> >> > TSocket socket =3D new >> >> > TSocket(DatabaseDescriptor.getListenAddress().getHostName(), >> >> > DatabaseDescriptor.getRpcPort()); >> >> > >> >> > TTransport transport; >> >> > >> >> > transport =3D socket; >> >> > >> >> > TBinaryProtocol binaryProtocol =3D new TBinaryProtocol(transport, >> false, >> >> > false); >> >> > >> >> > Cassandra.Client cassandraClient =3D new >> Cassandra.Client(binaryProtocol); >> >> > >> >> > transport.open(); >> >> > >> >> > thriftClient =3D cassandraClient; >> >> > >> >> > Set keyspaces =3D thriftClient.describe_keyspaces(); >> >> > >> >> > if (!keyspaces.contains(KEYSPACE)) >> >> > >> >> > { >> >> > >> >> > List cfDefs =3D new ArrayList(); >> >> > >> >> > thriftClient.system_add_keyspace(new KsDef(KEYSPACE, >> >> > "org.apache.cassandra.locator.RackUnawareStrategy", 1, cfDefs)); >> >> > >> >> > } >> >> > >> >> > thriftClient.set_keyspace(KEYSPACE); >> >> > >> >> > CfDef cfDef =3D new CfDef(KEYSPACE, COLUMN_FAMILY); >> >> > >> >> > try >> >> > >> >> > { >> >> > >> >> > thriftClient.system_add_column_family(cfDef); >> >> > >> >> > } >> >> > >> >> > catch (InvalidRequestException e) >> >> > >> >> > { >> >> > >> >> > throw new RuntimeException(e); >> >> > >> >> > } >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > On Mon, Jul 12, 2010 at 4:34 PM, Benjamin Black wrote: >> >> >> >> >> >> http://github.com/fauna/cassandra/tree/master/lib/cassandra/0.7/ >> >> >> >> >> >> Unclear to me what problems you are experiencing. >> >> >> >> >> >> On Sun, Jul 11, 2010 at 2:27 PM, GH wrote: >> >> >> > Hi Dop, >> >> >> > >> >> >> > Do you have any code on dynamically creating KeySpace and >> >> >> > ColumnFamily. >> >> >> > Currently I was all but creating a new client to do that which >> seems >> >> >> > to >> >> >> > be >> >> >> > the wrong way. >> >> >> > If you have something that works that will put me on the right >> track >> >> >> > I >> >> >> > hope. >> >> >> > >> >> >> > >> >> >> > Gavan >> >> >> > >> >> >> > >> >> >> > On Mon, Jul 12, 2010 at 2:41 AM, Dop Sun >> wrote: >> >> >> >> >> >> >> >> Based on current source codes in the head, moving from 0.6.x to >> 0.7, >> >> >> >> means >> >> >> >> some code changes in the client side (other than server side >> >> >> >> changes, >> >> >> >> like >> >> >> >> storage_conf.xml). >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Something like: >> >> >> >> >> >> >> >> 1. New Clock class instead of timestamp: this may be >> trivia, >> >> >> >> but >> >> >> >> it >> >> >> >> takes some time to change >> >> >> >> >> >> >> >> 2. Moving key space out of the API >> >> >> >> >> >> >> >> 3. Key changed from string to byte >> >> >> >> >> >> >> >> 4. Some API change, like get_count >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> I=92m still exploring the changes since I=92m working on a Java >> client >> >> >> >> for >> >> >> >> Cassandra. There should be longer list than what I have >> discovered. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> But, 0.7 is really good. I love the one can dynamically create >> Key >> >> >> >> Space >> >> >> >> and Column Family. Also, I love the key to be a byte array >> instead >> >> >> >> of >> >> >> >> string. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Enjoy the migrating. J >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Dop >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> From: GH [mailto:gavan.hood@gmail.com] >> >> >> >> Sent: Sunday, July 11, 2010 8:42 PM >> >> >> >> To: user@cassandra.apache.org >> >> >> >> Subject: Is anyone using version 0.7 schema update API >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> I want to move on to 0.7 using this API rather than >> storage-conf.xml >> >> >> >> conversion. >> >> >> >> >> >> >> >> Any info that you can advise on how you used it would be much >> >> >> >> appreciated. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Thanks >> >> >> >> >> >> >> >> Gavan >> >> >> > >> >> > >> >> > >> > >> > >> > > --000e0cd32ee6ae12cf048b50391f Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Check out step 4 of this page:=A0https://wiki.fourkitchens.com/display/P= F/Using+Cassandra+with+PHP

./compiler/cpp/thrift -gen php ../PATH-TO-CASSANDRA/interface/cassandra.= thrift

That is how to compile the thrift client from the cassan= dra bindings. Just replace the "php" with the language of your c= hoosing. According to http://wi= ki.apache.org/thrift/, "Thrift = has generators for C++, C#, Erlang, Haskell, Java, Objective C/Cocoa, OCaml= , Perl, PHP, Python, Ruby, and Squeak"

HTH
Dave Viner

On Tue, Jul 13, 2010 at 6:05 PM, GH &= lt;gavan.hood@gmail.com> wrote:
=A0
To be honest I do not know how to regenerate the binidings, I will loo= k into that.
ollowing your email, I went on and took the unit=A0test code and creat= ed a client. Given that this code works I am guessing that the thrift bindi= ngs are in place and it is more that the client code does not support the n= ew functions yet.
I might be off track and don't know if there it is appropriate for= someone as new to this as I am to make changes to the client and submit th= em (especially if some one else is already doing that). I could do that, if= it helped the group.
=A0
=A0


=A0
On Wed, Jul 14, 2010 at 2:12 AM, Benjamin Black = <b@b3k.u= s> wrote:
I updated the Ruby client to 0.7, but= I am not a Cassandra committer
(and not much of a Java guy), so haven&#= 39;t touched the Java client. =A0Is
there more to it than regenerating Thrift bindings?

On Tue, Jul 13, 2010 at 1:42 AM, GH <gavan.hood@gmail.com> wrote:
>= They are not complicated, its more that they are not in the package that > they should be in.
> I assume the client package exposes the functionality of the server an= d it
> does not have the ability to manage the tables in the database= that to me
> seems to be extremely limiting.
> When I did not = see that code in place I=A0assume that it is not complete or
> that I have not got the right code drop.
> From your commetns it= sounds like you don't support the Java client code
> base in lin= e with the ruby code. Which I think is limiting but is just the
> way= it is.
>
> On Tue, Jul 13, 2010 at 8:53 AM, Benjamin Black <b@b3k.us> wrote:
>>
= >> I guess I don't understand what is so complicated about the sc= hema
>> management calls that numerous examples are needed.
>>
>> On Mon, Jul 12, 2010 at 4:43 AM, GH <gavan.hood@gmail.com> wr= ote:
>> > Hi,
>> > My problem is that I cannot loca= te Java equivalents to the api calls you
>> > present in the ruby files you have presented. They are not vi= sible in
>> > the
>> > java client packages I have = (My code is not that old of trunk).
>> >
>> > I loc= ated the code below from some of the unit test code files.... This
>> > code
>> > will have to be refactored to create a = test.
>> > This=A0is=A0all I could find and it seems that there= must be better client
>> > examples than this.
>> >= ;
>> > I expected to see client code in the=A0 org.apache.cassandra.= cli package
>> > but
>> > there was nothing there. = (I searched all of the code for calls to these
>> > API's i= n the end)
>> > Where should I be looking to get proper Java code samples ?>> > Regards
>> > Gavan
>> >
>>= >
>> > Here is what I was about to refactor...
>> = >
>> > TSocket socket =3D new
>> > TSocket(DatabaseDescr= iptor.getListenAddress().getHostName(),
>> > DatabaseDescriptor= .getRpcPort());
>> >
>> > TTransport transport;
>> >
>> > transport =3D socket;
>> >
&g= t;> > TBinaryProtocol binaryProtocol =3D new TBinaryProtocol(transpor= t, false,
>> > false);
>> >
>> > Cassan= dra.Client cassandraClient =3D new Cassandra.Client(binaryProtocol);
>> >
>> > transport.open();
>> >
>&g= t; > thriftClient =3D cassandraClient;
>> >
>> >= Set<String> keyspaces =3D thriftClient.describe_keyspaces();
>= > >
>> > if (!keyspaces.contains(KEYSPACE))
>> >
>&g= t; > {
>> >
>> > List<CfDef> cfDefs =3D ne= w ArrayList<CfDef>();
>> >
>> > thriftClient.= system_add_keyspace(new KsDef(KEYSPACE,
>> > "org.apache.cassandra.locator.RackUnawareStrategy",= 1, cfDefs));
>> >
>> > }
>> >
>&= gt; > thriftClient.set_keyspace(KEYSPACE);
>> >
>> = > CfDef cfDef =3D new CfDef(KEYSPACE, COLUMN_FAMILY);
>> >
>> > try
>> >
>> > {
&= gt;> >
>> > thriftClient.system_add_column_family(cfDef);=
>> >
>> > }
>> >
>> > catc= h (InvalidRequestException e)
>> >
>> > {
>> >
>> > throw ne= w RuntimeException(e);
>> >
>> > }
>> >=
>> >
>> >
>> >
>> >
>> >
>> > On Mon, Jul 12, 2010 at 4:34 PM, Benjamin Bl= ack <b@b3k.us> wrot= e:
>> >>
>> >> http://git= hub.com/fauna/cassandra/tree/master/lib/cassandra/0.7/
>> >>
>> >> Unclear to me what problems you are = experiencing.
>> >>
>> >> On Sun, Jul 11, 201= 0 at 2:27 PM, GH <gavan.hood@gmail.com> wrote:
>> >> > Hi Dop,
>> >> >
>> >&g= t; > Do you have any code on dynamically creating KeySpace and
>&g= t; >> > ColumnFamily.
>> >> > Currently I was al= l but creating a new client to do that which seems
>> >> > to
>> >> > be
>> >>= > the wrong way.
>> >> > If you have something that w= orks that will put me on the right track
>> >> > I
>> >> > hope.
>> >> >
>> >>= >
>> >> > Gavan
>> >> >
>>= >> >
>> >> > On Mon, Jul 12, 2010 at 2:41 AM, D= op Sun <sunht@dops= un.com> wrote:
>> >> >>
>> >> >> Based on current s= ource codes in the head, moving from 0.6.x to 0.7,
>> >> >= ;> means
>> >> >> some code changes in the client s= ide (other than server side
>> >> >> changes,
>> >> >> like
&= gt;> >> >> storage_conf.xml).
>> >> >><= br>>> >> >>
>> >> >>
>> >= ;> >> Something like:
>> >> >>
>> >> >> 1.=A0=A0=A0=A0=A0= =A0 New Clock class instead of timestamp: this may be trivia,
>> &= gt;> >> but
>> >> >> it
>> >> = >> takes some time to change
>> >> >>
>> >> >> 2.=A0=A0=A0=A0=A0= =A0 Moving key space out of the API
>> >> >>
>&g= t; >> >> 3.=A0=A0=A0=A0=A0=A0 Key changed from string to byte>> >> >>
>> >> >> 4.=A0=A0=A0=A0=A0=A0 Some API change, like get_c= ount
>> >> >>
>> >> >>
>>= ; >> >>
>> >> >> I=92m still exploring the= changes since I=92m working on a Java client
>> >> >> for
>> >> >> Cassandra. The= re should be longer list than what I have discovered.
>> >> = >>
>> >> >>
>> >> >>
>> >> >> But, 0.7 is really good. I love the one can dyna= mically create Key
>> >> >> Space
>> >>= >> and Column Family. Also, I love the key to be a byte array instea= d
>> >> >> of
>> >> >> string.
>= > >> >>
>> >> >>
>> >> &= gt;>
>> >> >> Enjoy the migrating. J
>> &g= t;> >>
>> >> >>
>> >> >>
>> >&g= t; >> Dop
>> >> >>
>> >> >>=
>> >> >>
>> >> >> From: GH [mail= to:gavan.hood@gma= il.com]
>> >> >> Sent: Sunday, July 11, 2010 8:42 PM
>> = >> >> To: user@cassandra.apache.org
>> >> >> Sub= ject: Is anyone using version 0.7 schema update API
>> >> >>
>> >> >>
>> >&g= t; >>
>> >> >> I want to move on to 0.7 using th= is API rather than storage-conf.xml
>> >> >> conversio= n.
>> >> >>
>> >> >> Any info=A0that yo= u=A0can advise on how=A0you used it would be much
>> >> >= > appreciated.
>> >> >>
>> >> >&g= t;
>> >> >>
>> >> >> Thanks
>>= >> >>
>> >> >> Gavan
>> >>= >
>> >
>> >
>
>


--000e0cd32ee6ae12cf048b50391f--