Search in sources :

Example 1 with ByteBufferEntry

use of com.thinkaurelius.titan.diskstorage.keycolumnvalue.ByteBufferEntry in project titan by thinkaurelius.

the class CassandraThriftKeyColumnValueStore method excludeLastColumn.

private static List<Entry> excludeLastColumn(List<ColumnOrSuperColumn> row, ByteBuffer lastColumn) {
    List<Entry> entries = new ArrayList<Entry>();
    for (ColumnOrSuperColumn r : row) {
        Column c = r.getColumn();
        // Skip column if it is equal to columnEnd because columnEnd is exclusive
        if (lastColumn.equals(c.bufferForName()))
            break;
        entries.add(new ByteBufferEntry(c.bufferForName(), c.bufferForValue()));
    }
    return entries;
}
Also used : ColumnOrSuperColumn(org.apache.cassandra.thrift.ColumnOrSuperColumn) ByteBufferEntry(com.thinkaurelius.titan.diskstorage.keycolumnvalue.ByteBufferEntry) Entry(com.thinkaurelius.titan.diskstorage.keycolumnvalue.Entry) ByteBufferEntry(com.thinkaurelius.titan.diskstorage.keycolumnvalue.ByteBufferEntry) Column(org.apache.cassandra.thrift.Column) ColumnOrSuperColumn(org.apache.cassandra.thrift.ColumnOrSuperColumn) ArrayList(java.util.ArrayList)

Aggregations

ByteBufferEntry (com.thinkaurelius.titan.diskstorage.keycolumnvalue.ByteBufferEntry)1 Entry (com.thinkaurelius.titan.diskstorage.keycolumnvalue.Entry)1 ArrayList (java.util.ArrayList)1 Column (org.apache.cassandra.thrift.Column)1 ColumnOrSuperColumn (org.apache.cassandra.thrift.ColumnOrSuperColumn)1