You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Marc Canaleta <mc...@gmail.com> on 2010/09/16 09:38:57 UTC

0.7 live schema updates

Hi!

I like the new feature of making live schema updates. You can add, drop and
rename columns and keyspaces via thrift, but how do you modify column
attributes like key_cache_size or rows_cached?

Thank you.

RE: 0.7 live schema updates

Posted by Viktor Jevdokimov <Vi...@adform.com>.
But you'll loose these settings after Cassandra restart.

-----Original Message-----
From: Oleg Anastasyev [mailto:oleganas@gmail.com] 
Sent: Thursday, September 16, 2010 11:21 AM
To: user@cassandra.apache.org
Subject: Re: 0.7 live schema updates

You can change these attrs using JMX interface. Take a look at
org.apache.cassandra.tools.NodeProbe setCacheCapacities method.



Re: 0.7 live schema updates

Posted by Oleg Anastasyev <ol...@gmail.com>.
You can change these attrs using JMX interface. Take a look at
org.apache.cassandra.tools.NodeProbe setCacheCapacities method.


Re: 0.7 live schema updates

Posted by Gary Dusbabek <gd...@gmail.com>.
beta-2 will include the ability to set these values and others.  Look
for the system_update_column_family() and system_update_keyspace()
methods.

Gary.

On Thu, Sep 16, 2010 at 02:38, Marc Canaleta <mc...@gmail.com> wrote:
> Hi!
> I like the new feature of making live schema updates. You can add, drop and
> rename columns and keyspaces via thrift, but how do you modify column
> attributes like key_cache_size or rows_cached?
> Thank you.

Re: Getting client only example to work

Posted by Jonathan Ellis <jb...@gmail.com>.
You can run them both on the same machine, but it's always been the
case that multiple instances of StorageProxy need to be on different
IPs.  So you'll have to override ListenAddress.

On Thu, Sep 16, 2010 at 4:20 PM, Asif Jan <as...@gmail.com> wrote:
> ok, did something about the message service changed in the initClient
> method; essentially now one can not call initClient when a cassandra
> instance is running on the same machine.
>
> thanks
> On Sep 16, 2010, at 3:48 PM, Gary Dusbabek wrote:
>
>> I discovered some problems with the fat client earlier this week when
>> I tried using it.  It needs some fixes to keep up with all the 0.7
>> changes.
>>
>> Gary.
>>
>> On Thu, Sep 16, 2010 at 05:48, Asif Jan <as...@gmail.com> wrote:
>>>
>>> Hi
>>> I am using 0.7.0-beta1 , and trying to get the contrib/client_only
>>> example
>>> to work.
>>> I am running cassandra on host1, and trying to access it from host2.
>>> When using thirft (via cassandra-cli) and in my application; I am able to
>>> connect and do all operations as expected.
>>> But I am not able to connect to cassandra when using the code in
>>> client_only
>>>  (or far that matter using contrib/bmt_example). Since my test requires
>>> to
>>> do bulk insertion of about 1.4 TB of data, so I need to use a non-thirft
>>> interface.
>>> The error that I am getting is follows (the keyspace and the column
>>> family
>>> exist and can be used via Thirft) :
>>> 10/09/16 12:35:31 INFO config.DatabaseDescriptor: DiskAccessMode 'auto'
>>> determined to be mmap, indexAccessMode is mmap
>>> 10/09/16 12:35:31 INFO service.StorageService: Starting up client gossip
>>> Exception in thread "main" java.lang.IllegalArgumentException: Unknown
>>> ColumnFamily Standard1 in keyspace Keyspace1
>>> at
>>>
>>> org.apache.cassandra.config.DatabaseDescriptor.getComparator(DatabaseDescriptor.java:1009)
>>> at
>>>
>>> org.apache.cassandra.db.ColumnFamily.getComparatorFor(ColumnFamily.java:418)
>>> at gaia.cu7.cassandra.input.Ingestor.testWriting(Ingestor.java:103)
>>> at gaia.cu7.cassandra.input.Ingestor.main(Ingestor.java:187)
>>> I am using the following code (from client_only example) (also passing
>>> JVM
>>> parameter -Dstorage-config=path_2_cassandra.yaml)
>>>
>>>
>>> public static void main(String[] args) throws Exception {
>>> System.setProperty("storage-config","cassandra.yaml");
>>>        testWriting();
>>> }
>>>
>>> // from client_only example
>>>  private static void testWriting() throws Exception
>>>    {
>>>        StorageService.instance.initClient();
>>>        // sleep for a bit so that gossip can do its thing.
>>>        try
>>>        {
>>>            Thread.sleep(10000L);
>>>        }
>>>        catch (Exception ex)
>>>        {
>>>            throw new AssertionError(ex);
>>>        }
>>>        // do some writing.
>>>        final AbstractType comp =
>>> ColumnFamily.getComparatorFor("Keyspace1",
>>> "Standard1", null);
>>>        for (int i = 0; i < 100; i++)
>>>        {
>>>            RowMutation change = new RowMutation("Keyspace1", ("key" +
>>> i).getBytes());
>>>            ColumnPath cp = new
>>> ColumnPath("Standard1").setColumn(("colb").getBytes());
>>>            change.add(new QueryPath(cp), ("value" + i).getBytes(), new
>>> TimestampClock(0));
>>>            // don't call change.apply().  The reason is that is makes a
>>> static call into Table, which will perform
>>>            // local storage initialization, which creates local
>>> directories.
>>>            // change.apply();
>>>            StorageProxy.mutate(Arrays.asList(change));
>>>            System.out.println("wrote key" + i);
>>>        }
>>>        System.out.println("Done writing.");
>>>        StorageService.instance.stopClient();
>>>    }
>>>
>>>
>>>
>>>
>>>
>>>
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Re: Getting client only example to work

Posted by Asif Jan <as...@gmail.com>.
ok, did something about the message service changed in the initClient  
method; essentially now one can not call initClient when a cassandra  
instance is running on the same machine.

thanks
On Sep 16, 2010, at 3:48 PM, Gary Dusbabek wrote:

> I discovered some problems with the fat client earlier this week when
> I tried using it.  It needs some fixes to keep up with all the 0.7
> changes.
>
> Gary.
>
> On Thu, Sep 16, 2010 at 05:48, Asif Jan <as...@gmail.com> wrote:
>>
>> Hi
>> I am using 0.7.0-beta1 , and trying to get the contrib/client_only  
>> example
>> to work.
>> I am running cassandra on host1, and trying to access it from host2.
>> When using thirft (via cassandra-cli) and in my application; I am  
>> able to
>> connect and do all operations as expected.
>> But I am not able to connect to cassandra when using the code in  
>> client_only
>>  (or far that matter using contrib/bmt_example). Since my test  
>> requires to
>> do bulk insertion of about 1.4 TB of data, so I need to use a non- 
>> thirft
>> interface.
>> The error that I am getting is follows (the keyspace and the column  
>> family
>> exist and can be used via Thirft) :
>> 10/09/16 12:35:31 INFO config.DatabaseDescriptor: DiskAccessMode  
>> 'auto'
>> determined to be mmap, indexAccessMode is mmap
>> 10/09/16 12:35:31 INFO service.StorageService: Starting up client  
>> gossip
>> Exception in thread "main" java.lang.IllegalArgumentException:  
>> Unknown
>> ColumnFamily Standard1 in keyspace Keyspace1
>> at
>> org 
>> .apache 
>> .cassandra 
>> .config.DatabaseDescriptor.getComparator(DatabaseDescriptor.java: 
>> 1009)
>> at
>> org 
>> .apache 
>> .cassandra.db.ColumnFamily.getComparatorFor(ColumnFamily.java:418)
>> at gaia.cu7.cassandra.input.Ingestor.testWriting(Ingestor.java:103)
>> at gaia.cu7.cassandra.input.Ingestor.main(Ingestor.java:187)
>> I am using the following code (from client_only example) (also  
>> passing JVM
>> parameter -Dstorage-config=path_2_cassandra.yaml)
>>
>>
>> public static void main(String[] args) throws Exception {
>> System.setProperty("storage-config","cassandra.yaml");
>>         testWriting();
>> }
>>
>> // from client_only example
>>  private static void testWriting() throws Exception
>>     {
>>         StorageService.instance.initClient();
>>         // sleep for a bit so that gossip can do its thing.
>>         try
>>         {
>>             Thread.sleep(10000L);
>>         }
>>         catch (Exception ex)
>>         {
>>             throw new AssertionError(ex);
>>         }
>>         // do some writing.
>>         final AbstractType comp =  
>> ColumnFamily.getComparatorFor("Keyspace1",
>> "Standard1", null);
>>         for (int i = 0; i < 100; i++)
>>         {
>>             RowMutation change = new RowMutation("Keyspace1",  
>> ("key" +
>> i).getBytes());
>>             ColumnPath cp = new
>> ColumnPath("Standard1").setColumn(("colb").getBytes());
>>             change.add(new QueryPath(cp), ("value" + i).getBytes(),  
>> new
>> TimestampClock(0));
>>             // don't call change.apply().  The reason is that is  
>> makes a
>> static call into Table, which will perform
>>             // local storage initialization, which creates local
>> directories.
>>             // change.apply();
>>             StorageProxy.mutate(Arrays.asList(change));
>>             System.out.println("wrote key" + i);
>>         }
>>         System.out.println("Done writing.");
>>         StorageService.instance.stopClient();
>>     }
>>
>>
>>
>>
>>
>>


Re: Getting client only example to work

Posted by Gary Dusbabek <gd...@gmail.com>.
I discovered some problems with the fat client earlier this week when
I tried using it.  It needs some fixes to keep up with all the 0.7
changes.

Gary.

On Thu, Sep 16, 2010 at 05:48, Asif Jan <as...@gmail.com> wrote:
>
> Hi
> I am using 0.7.0-beta1 , and trying to get the contrib/client_only example
> to work.
> I am running cassandra on host1, and trying to access it from host2.
> When using thirft (via cassandra-cli) and in my application; I am able to
> connect and do all operations as expected.
> But I am not able to connect to cassandra when using the code in client_only
>  (or far that matter using contrib/bmt_example). Since my test requires to
> do bulk insertion of about 1.4 TB of data, so I need to use a non-thirft
> interface.
> The error that I am getting is follows (the keyspace and the column family
> exist and can be used via Thirft) :
> 10/09/16 12:35:31 INFO config.DatabaseDescriptor: DiskAccessMode 'auto'
> determined to be mmap, indexAccessMode is mmap
> 10/09/16 12:35:31 INFO service.StorageService: Starting up client gossip
> Exception in thread "main" java.lang.IllegalArgumentException: Unknown
> ColumnFamily Standard1 in keyspace Keyspace1
> at
> org.apache.cassandra.config.DatabaseDescriptor.getComparator(DatabaseDescriptor.java:1009)
> at
> org.apache.cassandra.db.ColumnFamily.getComparatorFor(ColumnFamily.java:418)
> at gaia.cu7.cassandra.input.Ingestor.testWriting(Ingestor.java:103)
> at gaia.cu7.cassandra.input.Ingestor.main(Ingestor.java:187)
> I am using the following code (from client_only example) (also passing JVM
> parameter -Dstorage-config=path_2_cassandra.yaml)
>
>
> public static void main(String[] args) throws Exception {
> System.setProperty("storage-config","cassandra.yaml");
>         testWriting();
> }
>
> // from client_only example
>  private static void testWriting() throws Exception
>     {
>         StorageService.instance.initClient();
>         // sleep for a bit so that gossip can do its thing.
>         try
>         {
>             Thread.sleep(10000L);
>         }
>         catch (Exception ex)
>         {
>             throw new AssertionError(ex);
>         }
>         // do some writing.
>         final AbstractType comp = ColumnFamily.getComparatorFor("Keyspace1",
> "Standard1", null);
>         for (int i = 0; i < 100; i++)
>         {
>             RowMutation change = new RowMutation("Keyspace1", ("key" +
> i).getBytes());
>             ColumnPath cp = new
> ColumnPath("Standard1").setColumn(("colb").getBytes());
>             change.add(new QueryPath(cp), ("value" + i).getBytes(), new
> TimestampClock(0));
>             // don't call change.apply().  The reason is that is makes a
> static call into Table, which will perform
>             // local storage initialization, which creates local
> directories.
>             // change.apply();
>             StorageProxy.mutate(Arrays.asList(change));
>             System.out.println("wrote key" + i);
>         }
>         System.out.println("Done writing.");
>         StorageService.instance.stopClient();
>     }
>
>
>
>
>
>

Getting client only example to work

Posted by Asif Jan <as...@gmail.com>.
Hi

I am using 0.7.0-beta1 , and trying to get the contrib/client_only  
example to work.

I am running cassandra on host1, and trying to access it from host2.

When using thirft (via cassandra-cli) and in my application; I am able  
to connect and do all operations as expected.

But I am not able to connect to cassandra when using the code in  
client_only  (or far that matter using contrib/bmt_example). Since my  
test requires to do bulk insertion of about 1.4 TB of data, so I need  
to use a non-thirft interface.

The error that I am getting is follows (the keyspace and the column  
family exist and can be used via Thirft) :

10/09/16 12:35:31 INFO config.DatabaseDescriptor: DiskAccessMode  
'auto' determined to be mmap, indexAccessMode is mmap
10/09/16 12:35:31 INFO service.StorageService: Starting up client gossip
Exception in thread "main" java.lang.IllegalArgumentException: Unknown  
ColumnFamily Standard1 in keyspace Keyspace1
	at  
org 
.apache 
.cassandra 
.config.DatabaseDescriptor.getComparator(DatabaseDescriptor.java:1009)
	at  
org 
.apache.cassandra.db.ColumnFamily.getComparatorFor(ColumnFamily.java: 
418)
	at gaia.cu7.cassandra.input.Ingestor.testWriting(Ingestor.java:103)
	at gaia.cu7.cassandra.input.Ingestor.main(Ingestor.java:187)

I am using the following code (from client_only example) (also passing  
JVM parameter -Dstorage-config=path_2_cassandra.yaml)



public static void main(String[] args) throws Exception {
	System.setProperty("storage-config","cassandra.yaml");

         testWriting();
}


// from client_only example

  private static void testWriting() throws Exception
	    {
	        StorageService.instance.initClient();
	        // sleep for a bit so that gossip can do its thing.
	        try
	        {
	            Thread.sleep(10000L);
	        }
	        catch (Exception ex)
	        {
	            throw new AssertionError(ex);
	        }

	        // do some writing.
	        final AbstractType comp =  
ColumnFamily.getComparatorFor("Keyspace1", "Standard1", null);
	        for (int i = 0; i < 100; i++)
	        {
	            RowMutation change = new RowMutation("Keyspace1", ("key"  
+ i).getBytes());
	            ColumnPath cp = new  
ColumnPath("Standard1").setColumn(("colb").getBytes());
	            change.add(new QueryPath(cp), ("value" + i).getBytes(),  
new TimestampClock(0));

	            // don't call change.apply().  The reason is that is  
makes a static call into Table, which will perform
	            // local storage initialization, which creates local  
directories.
	            // change.apply();

	            StorageProxy.mutate(Arrays.asList(change));
	            System.out.println("wrote key" + i);
	        }
	        System.out.println("Done writing.");
	        StorageService.instance.stopClient();
	    }