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
> >
>

Reply via email to