Example usage for org.apache.cassandra.db.partitions Partition unfilteredIterator

List of usage examples for org.apache.cassandra.db.partitions Partition unfilteredIterator

Introduction

In this page you can find the example usage for org.apache.cassandra.db.partitions Partition unfilteredIterator.

Prototype

public UnfilteredRowIterator unfilteredIterator();

Source Link

Document

Returns an UnfilteredRowIterator over all the rows/RT contained by this partition.

Usage

From source file:io.jmnarloch.cassandra.kafka.trigger.KafkaCommitLogTrigger.java

License:Apache License

@Override
public Collection<Mutation> augment(Partition update) {

    try (final CommitLog commitLog = new KafkaCommitLog(environment)) {
        final String key = getKey(update);
        final RowIterator rows = rowIterator(update.unfilteredIterator());
        while (rows.hasNext()) {
            final byte[] data = formatter
                    .format(new RowInfo(update.metadata(), update.partitionKey(), rows.next()));
            commitLog.commit(key, data);
        }/*from w  w  w  .j  a va 2s .c om*/
        return nothing();
    } catch (Exception e) {
        throw new CommitLogException("An unexpected error occurred when trying to export the row data", e);
    }
}