org.infinispan.query.clustered
Class ClusteredCacheQueryImpl

java.lang.Object
  extended by org.infinispan.query.impl.CacheQueryImpl
      extended by org.infinispan.query.clustered.ClusteredCacheQueryImpl
All Implemented Interfaces:
Iterable<Object>, CacheQuery

public class ClusteredCacheQueryImpl
extends CacheQueryImpl

A extension of CacheQueryImpl used for distributed queries.

Since:
5.1
Author:
Israel Lacerra

Field Summary
 
Fields inherited from class org.infinispan.query.impl.CacheQueryImpl
cache, hSearchQuery, keyTransformationHandler
 
Constructor Summary
ClusteredCacheQueryImpl(org.apache.lucene.search.Query luceneQuery, org.hibernate.search.spi.SearchFactoryIntegrator searchFactory, ExecutorService asyncExecutor, AdvancedCache<?,?> cache, KeyTransformationHandler keyTransformationHandler, Class<?>... classes)
           
 
Method Summary
 int getResultSize()
          Gets the integer number of results.
 QueryIterator iterator(int fetchSize)
          Returns the results of a search as a QueryIterator with a given integer parameter - the fetchSize.
 QueryIterator lazyIterator(int fetchSize)
          Lazily loads the results from the Query as a QueryIterator with a given integer parameter - the fetchSize.
 List<Object> list()
          Returns the results of a search as a list.
 CacheQuery sort(org.apache.lucene.search.Sort sort)
          Allows lucene to sort the results.
 
Methods inherited from class org.infinispan.query.impl.CacheQueryImpl
disableFullTextFilter, enableFullTextFilter, explain, filter, firstResult, getFacetManager, iterator, lazyIterator, maxResults, projection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClusteredCacheQueryImpl

public ClusteredCacheQueryImpl(org.apache.lucene.search.Query luceneQuery,
                               org.hibernate.search.spi.SearchFactoryIntegrator searchFactory,
                               ExecutorService asyncExecutor,
                               AdvancedCache<?,?> cache,
                               KeyTransformationHandler keyTransformationHandler,
                               Class<?>... classes)
Method Detail

sort

public CacheQuery sort(org.apache.lucene.search.Sort sort)
Description copied from interface: CacheQuery
Allows lucene to sort the results. Integers are sorted in descending order.

Specified by:
sort in interface CacheQuery
Overrides:
sort in class CacheQueryImpl
Parameters:
sort - - lucene sort object

getResultSize

public int getResultSize()
Description copied from interface: CacheQuery
Gets the integer number of results.

Specified by:
getResultSize in interface CacheQuery
Overrides:
getResultSize in class CacheQueryImpl
Returns:
The result size of the query.

iterator

public QueryIterator iterator(int fetchSize)
                       throws org.hibernate.search.SearchException
Description copied from interface: CacheQuery
Returns the results of a search as a QueryIterator with a given integer parameter - the fetchSize.

Specified by:
iterator in interface CacheQuery
Overrides:
iterator in class CacheQueryImpl
Parameters:
fetchSize - integer to be given to the implementation constructor.
Returns:
a QueryResultIterator which can be used to iterate through the results that were found.
Throws:
org.hibernate.search.SearchException

lazyIterator

public QueryIterator lazyIterator(int fetchSize)
Description copied from interface: CacheQuery
Lazily loads the results from the Query as a QueryIterator with a given integer parameter - the fetchSize.

Specified by:
lazyIterator in interface CacheQuery
Overrides:
lazyIterator in class CacheQueryImpl
Parameters:
fetchSize - integer to be passed into the lazy implementation of QueryIterator
Returns:
a QueryResultIterator which can be used to lazily iterate through results.

list

public List<Object> list()
                  throws org.hibernate.search.SearchException
Description copied from interface: CacheQuery
Returns the results of a search as a list.

Specified by:
list in interface CacheQuery
Overrides:
list in class CacheQueryImpl
Returns:
list of objects that were found from the search.
Throws:
org.hibernate.search.SearchException

-->

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