Search in sources :

Example 6 with ColumnIndex

use of org.apache.cassandra.index.sasi.conf.ColumnIndex in project cassandra by apache.

the class PerSSTableIndexWriter method nextUnfilteredCluster.

public void nextUnfilteredCluster(Unfiltered unfiltered) {
    if (!unfiltered.isRow())
        return;
    Row row = (Row) unfiltered;
    supportedIndexes.keySet().forEach((column) -> {
        ByteBuffer value = ColumnIndex.getValueOf(column, row, nowInSec);
        if (value == null)
            return;
        ColumnIndex columnIndex = supportedIndexes.get(column);
        if (columnIndex == null)
            return;
        Index index = indexes.get(column);
        if (index == null)
            indexes.put(column, (index = newIndex(columnIndex)));
        index.add(value.duplicate(), currentKey, currentKeyPosition);
    });
}
Also used : ColumnIndex(org.apache.cassandra.index.sasi.conf.ColumnIndex) ColumnIndex(org.apache.cassandra.index.sasi.conf.ColumnIndex) Row(org.apache.cassandra.db.rows.Row) ByteBuffer(java.nio.ByteBuffer)

Aggregations

ColumnIndex (org.apache.cassandra.index.sasi.conf.ColumnIndex)6 ByteBuffer (java.nio.ByteBuffer)3 ColumnMetadata (org.apache.cassandra.schema.ColumnMetadata)3 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 File (java.io.File)1 IOException (java.io.IOException)1 DecoratedKey (org.apache.cassandra.db.DecoratedKey)1 RowIndexEntry (org.apache.cassandra.db.RowIndexEntry)1 CompactionInterruptedException (org.apache.cassandra.db.compaction.CompactionInterruptedException)1 RowFilter (org.apache.cassandra.db.filter.RowFilter)1 Row (org.apache.cassandra.db.rows.Row)1 AbstractAnalyzer (org.apache.cassandra.index.sasi.analyzer.AbstractAnalyzer)1 PerSSTableIndexWriter (org.apache.cassandra.index.sasi.disk.PerSSTableIndexWriter)1 IndexMemtable (org.apache.cassandra.index.sasi.memory.IndexMemtable)1 QueryController (org.apache.cassandra.index.sasi.plan.QueryController)1 FSReadError (org.apache.cassandra.io.FSReadError)1 KeyIterator (org.apache.cassandra.io.sstable.KeyIterator)1 SSTableIdentityIterator (org.apache.cassandra.io.sstable.SSTableIdentityIterator)1 SSTableReader (org.apache.cassandra.io.sstable.format.SSTableReader)1 RandomAccessReader (org.apache.cassandra.io.util.RandomAccessReader)1