Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 65904 invoked from network); 12 Jul 2010 22:54:08 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Jul 2010 22:54:08 -0000 Received: (qmail 34121 invoked by uid 500); 12 Jul 2010 22:54:07 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 34086 invoked by uid 500); 12 Jul 2010 22:54:07 -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 34078 invoked by uid 99); 12 Jul 2010 22:54:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jul 2010 22:54:06 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.160.172] (HELO mail-gy0-f172.google.com) (209.85.160.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jul 2010 22:54:01 +0000 Received: by gyh3 with SMTP id 3so3189565gyh.31 for ; Mon, 12 Jul 2010 15:53:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.223.201 with SMTP id il9mr8829982qcb.89.1278975220192; Mon, 12 Jul 2010 15:53:40 -0700 (PDT) Received: by 10.229.224.141 with HTTP; Mon, 12 Jul 2010 15:53:40 -0700 (PDT) In-Reply-To: References: <005e01cb2117$ed5b2910$c8117b30$@com> Date: Mon, 12 Jul 2010 15:53:40 -0700 Message-ID: Subject: Re: Is anyone using version 0.7 schema update API From: Benjamin Black To: user@cassandra.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org 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 calls 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 c= ode > will have to be refactored to create a test. > This=A0is=A0all I could find and it seems that there must be better clien= t > 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 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 t= o >> > 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.=A0=A0=A0=A0=A0=A0 New Clock class instead of timestamp: this may b= e trivia, but >> >> it >> >> takes some time to change >> >> >> >> 2.=A0=A0=A0=A0=A0=A0 Moving key space out of the API >> >> >> >> 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_count >> >> >> >> >> >> >> >> I=92m still exploring the changes since I=92m working on a Java clien= t 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=A0that you=A0can advise on how=A0you used it would be much >> >> appreciated. >> >> >> >> >> >> >> >> Thanks >> >> >> >> Gavan >> > > >