Re: Embedded Cassandra server startup question

2011-01-21 Thread Anand Somani
It is a little slow not to the point where it concerns me (only have few tests for now), but keeps things very clean so no surprise effects. On Thu, Jan 20, 2011 at 6:33 PM, Roshan Dawrani roshandawr...@gmail.comwrote: On Fri, Jan 21, 2011 at 5:14 AM, Anand Somani meatfor...@gmail.comwrote:

Embedded Cassandra server startup question

2011-01-20 Thread Roshan Dawrani
Hi, I am using Cassandra for a Grails application and in that I start the embedded server when the Spring application context gets built. When I run my Grails app test suite - it first runs the integration and then functional test suite and it builds the application text individually for each

Re: Embedded Cassandra server startup question

2011-01-20 Thread Aaron Morton
Do you have a full error stack? That error is raised when the schema is added to an internal static map. There is a lot of static state so it's probably going to make your life easier if you can avoid reusing the JVM. Im guessing your errors comes from AbstractCassandraDaemon.setup() calling

Re: Embedded Cassandra server startup question

2011-01-20 Thread Anand Somani
Here is what worked for me, I use testNg, and initialize and createschema in the @BeforeClass for each test - In the @AfterClass, I had to drop schema, otherwise I was getting the same exception. - After this I started getting port conflict with the second test, so I added my own

Re: Embedded Cassandra server startup question

2011-01-20 Thread Roshan Dawrani
On Fri, Jan 21, 2011 at 3:02 AM, Aaron Morton aa...@thelastpickle.comwrote: Do you have a full error stack? That error is raised when the schema is added to an internal static map. There is a lot of static state so it's probably going to make your life easier if you can avoid reusing the

Re: Embedded Cassandra server startup question

2011-01-20 Thread Roshan Dawrani
On Fri, Jan 21, 2011 at 5:14 AM, Anand Somani meatfor...@gmail.com wrote: Here is what worked for me, I use testNg, and initialize and createschema in the @BeforeClass for each test - In the @AfterClass, I had to drop schema, otherwise I was getting the same exception. - After this

Re: Embedded Cassandra server startup question

2011-01-20 Thread Aaron Morton
There is a truncate() function that will clear a CF. It may leave a snapshot around, cannot remember exactly.Or you could drop and recreate the keyspace between tests using system_add_keyspace() and system_drop_keyspace(). The system tests in the test/system/__init__.py sort of do this.AaronOn 21

Re: Embedded Cassandra server startup question

2011-01-20 Thread Roshan Dawrani
On Fri, Jan 21, 2011 at 8:07 AM, Aaron Morton aa...@thelastpickle.comwrote: There is a truncate() function that will clear a CF. It may leave a snapshot around, cannot remember exactly. Or you could drop and recreate the keyspace between tests using system_add_keyspace() and

Re: Embedded Cassandra server startup question

2011-01-20 Thread Roshan Dawrani
On Fri, Jan 21, 2011 at 8:07 AM, Aaron Morton aa...@thelastpickle.comwrote: There is a truncate() function that will clear a CF. It may leave a snapshot around, cannot remember exactly. Not sure if Hector (0.7.0-22) has added truncate() to its API yet. I can't find it. In Hector, I see a

Re: Embedded Cassandra server startup question

2011-01-20 Thread Maxim Potekhin
You can script the actions you need and pipe the file into Cassandra-CLI. Works for me. On 1/20/2011 10:18 PM, Roshan Dawrani wrote: On Fri, Jan 21, 2011 at 8:07 AM, Aaron Morton aa...@thelastpickle.com mailto:aa...@thelastpickle.com wrote: There is a truncate() function that will clear a

Re: Embedded Cassandra server startup question

2011-01-20 Thread Roshan Dawrani
On Fri, Jan 21, 2011 at 8:52 AM, Maxim Potekhin potek...@bnl.gov wrote: You can script the actions you need and pipe the file into Cassandra-CLI. Works for me. Thanks Maxim, but first preference will be to do it through the API and not launch the Cassandra-CLI process with a scripted set of

Re: Embedded Cassandra server startup question

2011-01-20 Thread Roshan Dawrani
On Fri, Jan 21, 2011 at 8:56 AM, Roshan Dawrani roshandawr...@gmail.comwrote: On Fri, Jan 21, 2011 at 8:52 AM, Maxim Potekhin potek...@bnl.gov wrote: You can script the actions you need and pipe the file into Cassandra-CLI. Works for me. Probably CliMain / CliClient will help me there

Re: Embedded Cassandra server startup question

2011-01-20 Thread Roshan Dawrani
Back to square one on using CliMain/CliClient vs Cassandra/Hector API for cleanuup. It seems CliClient uses Antlr 3.1+ for parsing the statements passed to it, but I am using Grails that uses Antlr 2.7.7 (used by groovy code parsing), so I can't mix the two for programmatic use. Someone please

Re: Embedded Cassandra server startup question

2011-01-20 Thread Roshan Dawrani
Ok, got a Cassandra client from Hector and changed my clean-up to be truncate() based. Here is how I did it, if it could be any use to anyone: = HConnectionManager connectionManager = cassandraCluster.connectionManager CollectionConcurrentHClientPool