ModeShape Distribution 3.0.0.Beta4

Class BasicTupleCollector

  extended by
      extended by org.modeshape.jcr.query.lucene.LuceneQueryEngine.TupleCollector
          extended by org.modeshape.jcr.query.lucene.basic.BasicTupleCollector

public class BasicTupleCollector
extends LuceneQueryEngine.TupleCollector

The BasicLuceneSchema does not store any fields in the indexes, with the exception of the document identifier in which we're storing the key of the node that the document represents. Thus, in order to provide for each document the column values for each tuple, this collector looks up the CachedNode for each tuple using the QueryContext's RepositoryCache and then finds the property value for each required column.

In all cases, only the persisted workspace content appears in the indexes, so every Lucene Query only operates against this persisted content. However, the query results might reflect either only the persisted workspace content or the session's view of the content (which includes both its transient state as well as the persisted workspace content), depending upon whether the QueryContext's NodeCache is actually a WorkspaceCache or a SessionCache.

This class's constructor prepares the information that's ncessary to access the tuple values as fast as possible.

Nested Class Summary
protected static class BasicTupleCollector.LocalNameColumnAssignment
protected static class BasicTupleCollector.NameColumnAssignment
protected static class BasicTupleCollector.NodeDepthColumnAssignment
protected static class BasicTupleCollector.PathColumnAssignment
protected static class BasicTupleCollector.PseudoColumnAssignment
protected static class BasicTupleCollector.ScoreColumnAssignment
Constructor Summary
BasicTupleCollector(QueryContext queryContext, QueryResults.Columns columns)
Method Summary
 boolean acceptsDocsOutOfOrder()
 float doCollect(int doc)
 List<Object[]> getTuples()
          Get the tuples.
 void setNextReader(org.apache.lucene.index.IndexReader reader, int docBase)
 void setScorer( scorer)
Methods inherited from class org.modeshape.jcr.query.lucene.LuceneQueryEngine.TupleCollector
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public BasicTupleCollector(QueryContext queryContext,
                           QueryResults.Columns columns)
Method Detail


public void setScorer( scorer)
Specified by:
setScorer in class


public void setNextReader(org.apache.lucene.index.IndexReader reader,
                          int docBase)
Specified by:
setNextReader in class


public boolean acceptsDocsOutOfOrder()
Specified by:
acceptsDocsOutOfOrder in class


public float doCollect(int doc)
                throws IOException
Specified by:
doCollect in class LuceneQueryEngine.TupleCollector


public List<Object[]> getTuples()
Description copied from class: LuceneQueryEngine.TupleCollector
Get the tuples.

Specified by:
getTuples in class LuceneQueryEngine.TupleCollector
the tuples; never null

ModeShape Distribution 3.0.0.Beta4

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.