Very cool stuff, thanks for the info Dave, I will give this a shot... On Wed, Jul 14, 2010 at 1:03 PM, Dave Viner <davevi...@pobox.com> wrote:
> 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 <gavan.h...@gmail.com> 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 someone >> 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 <b...@b3k.us> 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 <gavan.h...@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 and >>> 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 >>> code >>> > 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 <b...@b3k.us> 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 <gavan.h...@gmail.com> 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 >>> >> > 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 = new >>> >> > TSocket(DatabaseDescriptor.getListenAddress().getHostName(), >>> >> > DatabaseDescriptor.getRpcPort()); >>> >> > >>> >> > TTransport transport; >>> >> > >>> >> > transport = socket; >>> >> > >>> >> > TBinaryProtocol binaryProtocol = new TBinaryProtocol(transport, >>> false, >>> >> > false); >>> >> > >>> >> > Cassandra.Client cassandraClient = new >>> Cassandra.Client(binaryProtocol); >>> >> > >>> >> > transport.open(); >>> >> > >>> >> > thriftClient = cassandraClient; >>> >> > >>> >> > Set<String> keyspaces = thriftClient.describe_keyspaces(); >>> >> > >>> >> > if (!keyspaces.contains(KEYSPACE)) >>> >> > >>> >> > { >>> >> > >>> >> > List<CfDef> cfDefs = new ArrayList<CfDef>(); >>> >> > >>> >> > thriftClient.system_add_keyspace(new KsDef(KEYSPACE, >>> >> > "org.apache.cassandra.locator.RackUnawareStrategy", 1, cfDefs)); >>> >> > >>> >> > } >>> >> > >>> >> > thriftClient.set_keyspace(KEYSPACE); >>> >> > >>> >> > CfDef cfDef = 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 <b...@b3k.us> 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 <gavan.h...@gmail.com> 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 <su...@dopsun.com> >>> 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’m still exploring the changes since I’m 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.h...@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 >>> >> >> > >>> >> > >>> >> > >>> > >>> > >>> >> >> >