Search in sources :

Example 1 with CounterSuperColumn

use of org.apache.cassandra.thrift.CounterSuperColumn in project scale7-pelops by s7.

the class Mutator method writeSubCounterColumns.

/**
     * Writes multiple sub-counter-column values to a super column.
     *
     * @param colFamily        The column family
     * @param rowKey           The key of the row to modify
     * @param colName          The name of the super column
     * @param subColumns       A list of the sub-counter-columns to write
     */
public Mutator writeSubCounterColumns(String colFamily, Bytes rowKey, Bytes colName, List<CounterColumn> subColumns) {
    safeGetRowKey(rowKey);
    validateColumnName(colName);
    validateCounterColumns(subColumns);
    CounterSuperColumn scol = new CounterSuperColumn(nullSafeGet(colName), subColumns);
    ColumnOrSuperColumn cosc = new ColumnOrSuperColumn();
    cosc.setCounter_super_column(scol);
    Mutation mutation = new Mutation();
    mutation.setColumn_or_supercolumn(cosc);
    getMutationList(colFamily, rowKey).add(mutation);
    return this;
}
Also used : ColumnOrSuperColumn(org.apache.cassandra.thrift.ColumnOrSuperColumn) CounterSuperColumn(org.apache.cassandra.thrift.CounterSuperColumn) Mutation(org.apache.cassandra.thrift.Mutation)

Aggregations

ColumnOrSuperColumn (org.apache.cassandra.thrift.ColumnOrSuperColumn)1 CounterSuperColumn (org.apache.cassandra.thrift.CounterSuperColumn)1 Mutation (org.apache.cassandra.thrift.Mutation)1