Infinispan Distribution 5.2.6.Final-redhat-2

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
 CacheQuery firstResult(int firstResult)
          Sets the the result of the given integer value to the first result.
 int getResultSize()
          Gets the integer number of results.
 ResultIterator iterator(FetchOptions fetchOptions)
          Returns the results of a search as a ResultIterator.
 List<Object> list()
          Returns the results of a search as a list.
 CacheQuery maxResults(int maxResults)
          Sets the maximum number of results to the number passed in as a parameter.
 CacheQuery sort(org.apache.lucene.search.Sort sort)
          Allows lucene to sort the results.
 CacheQuery timeout(long timeout, TimeUnit timeUnit)
          Set the timeout for this query.
 
Methods inherited from class org.infinispan.query.impl.CacheQueryImpl
disableFullTextFilter, enableFullTextFilter, explain, filter, getFacetManager, iterator, 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

maxResults

public CacheQuery maxResults(int maxResults)
Description copied from interface: CacheQuery
Sets the maximum number of results to the number passed in as a parameter.

Specified by:
maxResults in interface CacheQuery
Overrides:
maxResults in class CacheQueryImpl
Parameters:
maxResults - that are to be set to the maxResults.

firstResult

public CacheQuery firstResult(int firstResult)
Description copied from class: CacheQueryImpl
Sets the the result of the given integer value to the first result.

Specified by:
firstResult in interface CacheQuery
Overrides:
firstResult in class CacheQueryImpl
Parameters:
firstResult - index to be set.

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 ResultIterator iterator(FetchOptions fetchOptions)
                        throws org.hibernate.search.SearchException
Description copied from interface: CacheQuery
Returns the results of a search as a ResultIterator. Warning: the return type is an extension of Iterator which introduces a ResultIterator.close() method. This close method needs to be invoked when the iteration is complete to avoid resource leakage.

Specified by:
iterator in interface CacheQuery
Overrides:
iterator in class CacheQueryImpl
Parameters:
fetchOptions - how to fetch results (see @link FetchOptions)
Returns:
a QueryResultIterator which can be used to iterate through the results that were found.
Throws:
org.hibernate.search.SearchException

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

timeout

public CacheQuery timeout(long timeout,
                          TimeUnit timeUnit)
Description copied from interface: CacheQuery
Set the timeout for this query. If the query hasn't finished processing before the timeout, an exception will be thrown.

Specified by:
timeout in interface CacheQuery
Overrides:
timeout in class CacheQueryImpl
Parameters:
timeout - the timeout duration
timeUnit - the time unit of the timeout parameter
Returns:

Infinispan Distribution 5.2.6.Final-redhat-2

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