Example usage for org.apache.cassandra.db.rows UnfilteredRowIterator close

List of usage examples for org.apache.cassandra.db.rows UnfilteredRowIterator close

Introduction

In this page you can find the example usage for org.apache.cassandra.db.rows UnfilteredRowIterator close.

Prototype

public void close();

Source Link

Usage

From source file:com.stratio.cassandra.lucene.IndexReaderSkinny.java

License:Apache License

@Override
protected boolean prepareNext() {
    while (next == null && documents.hasNext()) {
        Pair<Document, ScoreDoc> nextDoc = documents.next();
        DecoratedKey key = service.decoratedKey(nextDoc.left);
        ClusteringIndexFilter filter = command.clusteringIndexFilter(key);
        UnfilteredRowIterator data = read(key, filter);
        if (data != null) {
            if (data.isEmpty()) {
                data.close();
            } else {
                next = data;/*from   w w  w. j a  v  a 2s  .c  o  m*/
                cacheUpdater.put(key, nextDoc.right);
            }
        }
    }
    return next != null;
}

From source file:com.stratio.cassandra.lucene.IndexReaderWide.java

License:Apache License

@Override
protected boolean prepareNext() {

    if (next != null) {
        return true;
    }//from   w  w  w  .  j a  va 2 s . co m

    if (nextDoc == null) {
        if (!documents.hasNext()) {
            return false;
        }
        nextDoc = documents.next();
    }

    DecoratedKey key = service.decoratedKey(nextDoc.left);
    NavigableSet<Clustering> clusterings = clusterings(key);

    if (clusterings.isEmpty()) {
        return prepareNext();
    }

    ClusteringIndexFilter filter = new ClusteringIndexNamesFilter(clusterings, false);
    UnfilteredRowIterator data = read(key, filter);

    if (data.isEmpty()) {
        data.close();
        return prepareNext();
    }

    next = data;
    return true;
}

From source file:io.puntanegra.fhir.index.FhirIndexSearcher.java

License:Apache License

@Override
public boolean hasNext() {
    if (next != null) {
        return true;
    }/*from  w  ww  . j av a  2s .co m*/

    if (nextDoc == null) {
        if (!documents.hasNext()) {
            return false;
        }
        nextDoc = documents.next();
    }

    DecoratedKey key = service.decoratedKey(nextDoc.left);
    NavigableSet<Clustering> clusterings = clusterings(key);

    if (clusterings.isEmpty()) {
        return hasNext();
    }

    ClusteringIndexFilter filter = new ClusteringIndexNamesFilter(clusterings, false);
    UnfilteredRowIterator data = read(key, filter);

    if (data.isEmpty()) {
        data.close();
        return hasNext();
    }

    next = data;
    return true;
}