incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Black...@b3k.us>
Subject Re: Is anyone using version 0.7 schema update API
Date Tue, 13 Jul 2010 16:12:46 GMT
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.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 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.hood@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.hood@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 <sunht@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.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
>> >> >
>> >
>> >
>
>

Mime
View raw message