且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当另一个更新时,Cassandra触发更新表

更新时间:2022-12-10 16:29:16

您使用错误的键来创建Mutation实例_工作代码

You are using wrong key to create Mutation instance
Here is the working code

public Collection<Mutation> augment(ByteBuffer key, ColumnFamily update) 
{    
    List<Mutation> mutations = new ArrayList<Mutation>(update.getColumnCount());

    for (Cell cell : update)
    {
        if (cell.value().remaining() > 0)
        {
            Mutation mutation = new Mutation(properties.getProperty("keyspace"), key);
            mutation.add(properties.getProperty("columnfamily"), cell.name(), cell.value(), System.currentTimeMillis());
            mutations.add(mutation);
        }
   }
   return mutations;
}