Search in sources :

Example 1 with ColumnFamilySerializer

use of org.apache.cassandra.db.ColumnFamilySerializer in project eiger by wlloyd.

the class SSTableNamesIterator method read.

private void read(SSTableReader sstable, FileDataInput file) throws IOException {
    Filter bf = IndexHelper.defreezeBloomFilter(file, sstable.descriptor.usesOldBloomFilter);
    List<IndexHelper.IndexInfo> indexList = IndexHelper.deserializeIndex(file);
    // we can stop early if bloom filter says none of the columns actually exist -- but,
    // we can't stop before initializing the cf above, in case there's a relevant tombstone
    ColumnFamilySerializer serializer = ColumnFamily.serializer();
    try {
        cf = serializer.deserializeFromSSTableNoColumns(ColumnFamily.create(sstable.metadata), file);
    } catch (Exception e) {
        throw new IOException(serializer + " failed to deserialize " + sstable.getColumnFamilyName() + " with " + sstable.metadata + " from " + file, e);
    }
    List<ByteBuffer> filteredColumnNames = new ArrayList<ByteBuffer>(columns.size());
    for (ByteBuffer name : columns) {
        if (bf.isPresent(name)) {
            filteredColumnNames.add(name);
        }
    }
    if (filteredColumnNames.isEmpty())
        return;
    if (indexList == null)
        readSimpleColumns(file, columns, filteredColumnNames);
    else
        readIndexedColumns(sstable.metadata, file, columns, filteredColumnNames, indexList);
    // create an iterator view of the columns we read
    iter = cf.iterator();
}
Also used : ColumnFamilySerializer(org.apache.cassandra.db.ColumnFamilySerializer) Filter(org.apache.cassandra.utils.Filter) IOException(java.io.IOException) ByteBuffer(java.nio.ByteBuffer) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 ByteBuffer (java.nio.ByteBuffer)1 ColumnFamilySerializer (org.apache.cassandra.db.ColumnFamilySerializer)1 Filter (org.apache.cassandra.utils.Filter)1