cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacques-Henri Berthemet <jacques-henri.berthe...@genesys.com>
Subject Re: cass-2.2 trigger - how to get clustering columns and value?
Date Thu, 11 Apr 2019 07:36:23 GMT
Hi,

You should take a look at how Stratio’s Lucene index decodes CFs and keys, start from RowService.doIndex()
implementations:
https://github.com/Stratio/cassandra-lucene-index/tree/branch-2.2.13/plugin/src/main/java/com/stratio/cassandra/lucene/service

Note that in some cases an update without values is a delete of the Cell.

Regards,
Jacques-Henri Berthemet

From: Carl Mueller <carl.mueller@smartthings.com.INVALID>
Reply-To: "user@cassandra.apache.org" <user@cassandra.apache.org>
Date: Wednesday 10 April 2019 at 23:53
To: "user@cassandra.apache.org" <user@cassandra.apache.org>
Subject: cass-2.2 trigger - how to get clustering columns and value?

We have a multitenant cluster that we can't upgrade to 3.x easily, and we'd like to migrate
some apps off of the shared cluster to dedicated clusters.

This is a 2.2 cluster.

So I'm trying a trigger to track updates while we transition and will send via kafka. Right
now I'm just trying to extract all the data from the incoming updates

so for
    public Collection<Mutation> augment(ByteBuffer key, ColumnFamily update) {

the names returned by the update.getColumnNames() for an update of a table with two clustering
columns and had a regular column update produced two CellName/Cells:

one has no name, and no apparent raw value (bytebuffer is empty)

the other is the data column.

I can extract the primary key from the key field

But how do I get the values of the two clustering columns? They aren't listed in the iterator,
and they don't appear to be in the key field. Since clustering columns are encoded into the
name of a cell, I'd imagine there might be some "unpacking" trick to that.
Mime
View raw message