cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinak Pani <nishant.has.a.quest...@gmail.com>
Subject A trigger that modifies the current Mutation
Date Sun, 28 Sep 2014 06:08:03 GMT
Hi,

I wanted to create a trigger that alters the current mutation. For example,
I wanted to, say, iterate through the ColumnFamily in augment method and
look for all the fields that are of type text or varchar and change them to
upper case. I am not sure how to do that. Can someone help me?

Basically, this is what I wanted to do:

public class AllCapsTrigger implements ITrigger {

  public Collection<Mutation> augment(ByteBuffer key, ColumnFamily cf) {
    for(Cell cell: cf){
      if(cell.value().hasRemaining()){
        System.out.println("Value:  " + new String(cell.value().array(),
StandardCharsets.UTF_8));

        /**
         * Check if cell is of type text/varchar
         * Set cell value to upper case of what it has
         **/
      }
    }

    return null;
  }
}

Thanks for reading this.

Regards,
Pinak

Mime
View raw message