You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Paul Loy <ke...@gmail.com> on 2011/06/03 18:14:54 UTC

Loading Keyspace from YAML in 0.8

We embed cassandra in our app. When we first load a cluster, we specify one
node in the cluster as the seed node. This node installs the schema using
StorageService.instance.loadKeyspacesFromYAML(). This call has disappeared
in 0.8.

How can we do the same thing in Cassandra 0.8?

Thanks,

-- 
---------------------------------------------
Paul Loy
paul@keteracel.com
http://uk.linkedin.com/in/paulloy

Re: Loading Keyspace from YAML in 0.8

Posted by Colin Taylor <co...@gmail.com>.
Its ugly for integration testing ...

Socket socket = new Socket("127.0.0.1", 9170);
        final OutputStream cli = socket.getOutputStream();
        log.info("loading schema via cli");
        new PrintWriter(cli).print(new String(readFully(new
FileInputStream("cassandra-schema"))));
        cli.close();

On Sat, Jun 4, 2011 at 4:17 AM, Jeremy Hanna <je...@gmail.com> wrote:
> In 0.8 (and 0.7) you can have a script that you create that you can run on the CLI that creates your schema.  We create something like a ddl file and run it on a new cluster.  You just pass it to the cli with -f <file.txt>.
>
> On Jun 3, 2011, at 11:14 AM, Paul Loy wrote:
>
>> We embed cassandra in our app. When we first load a cluster, we specify one node in the cluster as the seed node. This node installs the schema using StorageService.instance.loadKeyspacesFromYAML(). This call has disappeared in 0.8.
>>
>> How can we do the same thing in Cassandra 0.8?
>>
>> Thanks,
>>
>> --
>> ---------------------------------------------
>> Paul Loy
>> paul@keteracel.com
>> http://uk.linkedin.com/in/paulloy
>
>

Re: Loading Keyspace from YAML in 0.8

Posted by Robert Jackson <ro...@promedicalinc.com>.
Enter the cli with: 


bin/cassandra-cli --host localhost 



Then execute the commands to create the keyspaces and column families you need: 



create keyspace Twitter with 
placement_strategy = 'org.apache.cassandra.locator.LocalStrategy' AND 
strategy_options = [{replication_factor:1}]; 
use Twitter; 
create column family Users with comparator = 'UTF8Type'; 
create column family UserAudits with comparator = 'UTF8Type'; 



See the DataStax documentation for more info: 


http://www.datastax.com/docs/0.8/cli/using_cli 

Robert Jackson 

----- Original Message -----

From: "Jeremy Hanna" <je...@gmail.com> 
To: user@cassandra.apache.org 
Sent: Friday, June 3, 2011 12:17:06 PM 
Subject: Re: Loading Keyspace from YAML in 0.8 

In 0.8 (and 0.7) you can have a script that you create that you can run on the CLI that creates your schema. We create something like a ddl file and run it on a new cluster. You just pass it to the cli with -f <file.txt>. 

On Jun 3, 2011, at 11:14 AM, Paul Loy wrote: 

> We embed cassandra in our app. When we first load a cluster, we specify one node in the cluster as the seed node. This node installs the schema using StorageService.instance.loadKeyspacesFromYAML(). This call has disappeared in 0.8. 
> 
> How can we do the same thing in Cassandra 0.8? 
> 
> Thanks, 
> 
> -- 
> --------------------------------------------- 
> Paul Loy 
> paul@keteracel.com 
> http://uk.linkedin.com/in/paulloy 



Re: Loading Keyspace from YAML in 0.8

Posted by Jeremy Hanna <je...@gmail.com>.
In 0.8 (and 0.7) you can have a script that you create that you can run on the CLI that creates your schema.  We create something like a ddl file and run it on a new cluster.  You just pass it to the cli with -f <file.txt>.

On Jun 3, 2011, at 11:14 AM, Paul Loy wrote:

> We embed cassandra in our app. When we first load a cluster, we specify one node in the cluster as the seed node. This node installs the schema using StorageService.instance.loadKeyspacesFromYAML(). This call has disappeared in 0.8.
> 
> How can we do the same thing in Cassandra 0.8?
> 
> Thanks,
> 
> -- 
> ---------------------------------------------
> Paul Loy
> paul@keteracel.com
> http://uk.linkedin.com/in/paulloy


Re: Loading Keyspace from YAML in 0.8

Posted by Paul Loy <ke...@gmail.com>.
+1

On Fri, Jun 3, 2011 at 9:44 PM, Jeremiah Jordan <
JEREMIAH.JORDAN@morningstar.com> wrote:

>  Or at least someone should write a script which will take a YAML config
> and turn it into a CLI script.
>
>  ------------------------------
> *From:* Edward Capriolo [mailto:edlinuxguru@gmail.com]
> *Sent:* Friday, June 03, 2011 12:00 PM
>
> *To:* user@cassandra.apache.org
> *Subject:* Re: Loading Keyspace from YAML in 0.8
>
>
>
> On Fri, Jun 3, 2011 at 12:35 PM, Paul Loy <ke...@gmail.com> wrote:
>
>> ugh!
>>
>> On Fri, Jun 3, 2011 at 5:19 PM, Edward Capriolo <ed...@gmail.com>wrote:
>>
>>>
>>>
>>> On Fri, Jun 3, 2011 at 12:14 PM, Paul Loy <ke...@gmail.com> wrote:
>>>
>>>> We embed cassandra in our app. When we first load a cluster, we specify
>>>> one node in the cluster as the seed node. This node installs the schema
>>>> using StorageService.instance.loadKeyspacesFromYAML(). This call has
>>>> disappeared in 0.8.
>>>>
>>>> How can we do the same thing in Cassandra 0.8?
>>>>
>>>> Thanks,
>>>>
>>>> --
>>>> ---------------------------------------------
>>>> Paul Loy
>>>> paul@keteracel.com
>>>> http://uk.linkedin.com/in/paulloy
>>>>
>>>
>>> That was only a feature for migration from 0.6.X->0.7.X.
>>>
>>> You can use bin/bassandra-cli -f <file_with defs>
>>>
>>> But I would use the methods in thrift such as  system_add_keyspace().
>>>
>>> Edward
>>>
>>
>>
>>
>> --
>> ---------------------------------------------
>> Paul Loy
>> paul@keteracel.com
>> http://uk.linkedin.com/in/paulloy
>>
>
> Yes, Cassandra is very aggressive with deprecating stuff. However to be
> fair it is clear that StorageService is subject to change at any time.
> With things like this I personally do not see the harm in letting them hang
> around for a while. In fact I really think it should be added back, because
> it makes me wonder what the MANY people going from 0.6.X to 0.8.X are going
> to do.
>
>
>
>



-- 
---------------------------------------------
Paul Loy
paul@keteracel.com
http://uk.linkedin.com/in/paulloy

RE: Loading Keyspace from YAML in 0.8

Posted by Jeremiah Jordan <JE...@morningstar.com>.
Or at least someone should write a script which will take a YAML config
and turn it into a CLI script.

________________________________

From: Edward Capriolo [mailto:edlinuxguru@gmail.com] 
Sent: Friday, June 03, 2011 12:00 PM
To: user@cassandra.apache.org
Subject: Re: Loading Keyspace from YAML in 0.8




On Fri, Jun 3, 2011 at 12:35 PM, Paul Loy <ke...@gmail.com> wrote:


	ugh!
	
	
	On Fri, Jun 3, 2011 at 5:19 PM, Edward Capriolo
<ed...@gmail.com> wrote:
	



		On Fri, Jun 3, 2011 at 12:14 PM, Paul Loy
<ke...@gmail.com> wrote:
		

			We embed cassandra in our app. When we first
load a cluster, we specify one node in the cluster as the seed node.
This node installs the schema using
StorageService.instance.loadKeyspacesFromYAML(). This call has
disappeared in 0.8.
			
			How can we do the same thing in Cassandra 0.8?
			
			Thanks,
			
			-- 
			---------------------------------------------
			Paul Loy
			paul@keteracel.com
			http://uk.linkedin.com/in/paulloy
			


		That was only a feature for migration from 0.6.X->0.7.X.
		
		You can use bin/bassandra-cli -f <file_with defs>
		
		But I would use the methods in thrift such as
system_add_keyspace(). 
		
		Edward
		




	-- 
	---------------------------------------------
	Paul Loy
	paul@keteracel.com
	http://uk.linkedin.com/in/paulloy
	


Yes, Cassandra is very aggressive with deprecating stuff. However to be
fair it is clear that StorageService is subject to change at any time. 
With things like this I personally do not see the harm in letting them
hang around for a while. In fact I really think it should be added back,
because it makes me wonder what the MANY people going from 0.6.X to
0.8.X are going to do. 


 


Re: Loading Keyspace from YAML in 0.8

Posted by Edward Capriolo <ed...@gmail.com>.
On Fri, Jun 3, 2011 at 12:35 PM, Paul Loy <ke...@gmail.com> wrote:

> ugh!
>
> On Fri, Jun 3, 2011 at 5:19 PM, Edward Capriolo <ed...@gmail.com>wrote:
>
>>
>>
>> On Fri, Jun 3, 2011 at 12:14 PM, Paul Loy <ke...@gmail.com> wrote:
>>
>>> We embed cassandra in our app. When we first load a cluster, we specify
>>> one node in the cluster as the seed node. This node installs the schema
>>> using StorageService.instance.loadKeyspacesFromYAML(). This call has
>>> disappeared in 0.8.
>>>
>>> How can we do the same thing in Cassandra 0.8?
>>>
>>> Thanks,
>>>
>>> --
>>> ---------------------------------------------
>>> Paul Loy
>>> paul@keteracel.com
>>> http://uk.linkedin.com/in/paulloy
>>>
>>
>> That was only a feature for migration from 0.6.X->0.7.X.
>>
>> You can use bin/bassandra-cli -f <file_with defs>
>>
>> But I would use the methods in thrift such as  system_add_keyspace().
>>
>> Edward
>>
>
>
>
> --
> ---------------------------------------------
> Paul Loy
> paul@keteracel.com
> http://uk.linkedin.com/in/paulloy
>

Yes, Cassandra is very aggressive with deprecating stuff. However to be fair
it is clear that StorageService is subject to change at any time.
With things like this I personally do not see the harm in letting them hang
around for a while. In fact I really think it should be added back, because
it makes me wonder what the MANY people going from 0.6.X to 0.8.X are going
to do.

Re: Loading Keyspace from YAML in 0.8

Posted by Paul Loy <ke...@gmail.com>.
ugh!

On Fri, Jun 3, 2011 at 5:19 PM, Edward Capriolo <ed...@gmail.com>wrote:

>
>
> On Fri, Jun 3, 2011 at 12:14 PM, Paul Loy <ke...@gmail.com> wrote:
>
>> We embed cassandra in our app. When we first load a cluster, we specify
>> one node in the cluster as the seed node. This node installs the schema
>> using StorageService.instance.loadKeyspacesFromYAML(). This call has
>> disappeared in 0.8.
>>
>> How can we do the same thing in Cassandra 0.8?
>>
>> Thanks,
>>
>> --
>> ---------------------------------------------
>> Paul Loy
>> paul@keteracel.com
>> http://uk.linkedin.com/in/paulloy
>>
>
> That was only a feature for migration from 0.6.X->0.7.X.
>
> You can use bin/bassandra-cli -f <file_with defs>
>
> But I would use the methods in thrift such as  system_add_keyspace().
>
> Edward
>



-- 
---------------------------------------------
Paul Loy
paul@keteracel.com
http://uk.linkedin.com/in/paulloy

Re: Loading Keyspace from YAML in 0.8

Posted by Edward Capriolo <ed...@gmail.com>.
On Fri, Jun 3, 2011 at 12:14 PM, Paul Loy <ke...@gmail.com> wrote:

> We embed cassandra in our app. When we first load a cluster, we specify one
> node in the cluster as the seed node. This node installs the schema using
> StorageService.instance.loadKeyspacesFromYAML(). This call has disappeared
> in 0.8.
>
> How can we do the same thing in Cassandra 0.8?
>
> Thanks,
>
> --
> ---------------------------------------------
> Paul Loy
> paul@keteracel.com
> http://uk.linkedin.com/in/paulloy
>

That was only a feature for migration from 0.6.X->0.7.X.

You can use bin/bassandra-cli -f <file_with defs>

But I would use the methods in thrift such as  system_add_keyspace().

Edward