You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by kaveh minooie <ka...@plutoz.com> on 2013/10/28 20:36:36 UTC

need help with triggers

Hi

I am not sure if, stricly speaking, this is a dev list issue, but i 
figured I would probably have a better chance here than user list. I am 
using cassandra 2.0.1 and I am trying to write a trigger, but I am 
having an issue. in the augment function:

public Collection<RowMutation> augment(ByteBuffer key, ColumnFamily update)

the instance that I get in variable 'update' is of type 
'org.apache.cassandra.db.UnsortedColumns' instead of type ColumnFamily 
which does not support lots of method that exist in ColumnFamily including:

public Column getColumn(ByteBuffer name)
     {
         throw new UnsupportedOperationException();
     }

Now what I want to know is, first of all, why I am getting an 
unsortedColumns instead of ColumnFamily? and how I can access my columns 
from this class anyway?

the CF that I am running this trigger on is created using CQL3.

thanks,
-- 
Kaveh Minooie

Re: need help with triggers

Posted by kaveh minooie <ka...@plutoz.com>.
I know that, but in all the example that I have seen online, they are 
getting an object of actuall 'ColumnFamily'. I was wondering why I am 
getting a UsortedClumns instead of ColumnFamily.

and thanks for pointing out column iterator to me. that is gonna be 
usefull ;)


On 10/28/2013 01:28 PM, Jonathan Ellis wrote:
> UnsortedColumns is a subclass of CF that only supports iterating
> through the cells, not random access.
>
> On Mon, Oct 28, 2013 at 2:36 PM, kaveh minooie <ka...@plutoz.com> wrote:
>> Hi
>>
>> I am not sure if, stricly speaking, this is a dev list issue, but i figured
>> I would probably have a better chance here than user list. I am using
>> cassandra 2.0.1 and I am trying to write a trigger, but I am having an
>> issue. in the augment function:
>>
>> public Collection<RowMutation> augment(ByteBuffer key, ColumnFamily update)
>>
>> the instance that I get in variable 'update' is of type
>> 'org.apache.cassandra.db.UnsortedColumns' instead of type ColumnFamily which
>> does not support lots of method that exist in ColumnFamily including:
>>
>> public Column getColumn(ByteBuffer name)
>>      {
>>          throw new UnsupportedOperationException();
>>      }
>>
>> Now what I want to know is, first of all, why I am getting an
>> unsortedColumns instead of ColumnFamily? and how I can access my columns
>> from this class anyway?
>>
>> the CF that I am running this trigger on is created using CQL3.
>>
>> thanks,
>> --
>> Kaveh Minooie
>
>
>

-- 
Kaveh Minooie

Re: need help with triggers

Posted by Jonathan Ellis <jb...@gmail.com>.
UnsortedColumns is a subclass of CF that only supports iterating
through the cells, not random access.

On Mon, Oct 28, 2013 at 2:36 PM, kaveh minooie <ka...@plutoz.com> wrote:
> Hi
>
> I am not sure if, stricly speaking, this is a dev list issue, but i figured
> I would probably have a better chance here than user list. I am using
> cassandra 2.0.1 and I am trying to write a trigger, but I am having an
> issue. in the augment function:
>
> public Collection<RowMutation> augment(ByteBuffer key, ColumnFamily update)
>
> the instance that I get in variable 'update' is of type
> 'org.apache.cassandra.db.UnsortedColumns' instead of type ColumnFamily which
> does not support lots of method that exist in ColumnFamily including:
>
> public Column getColumn(ByteBuffer name)
>     {
>         throw new UnsupportedOperationException();
>     }
>
> Now what I want to know is, first of all, why I am getting an
> unsortedColumns instead of ColumnFamily? and how I can access my columns
> from this class anyway?
>
> the CF that I am running this trigger on is created using CQL3.
>
> thanks,
> --
> Kaveh Minooie



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder, http://www.datastax.com
@spyced