Package org.infinispan.query.impl
Class IndexedQueryImpl<E>
java.lang.Object
org.infinispan.query.impl.IndexedQueryImpl<E>
- All Implemented Interfaces:
IndexedQuery<E>
Lucene based indexed query implementation.
- Author:
- Navin Surtani, Sanne Grinovero <sanne@hibernate.org> (C) 2011 Red Hat Inc., Marko Luksa
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AdvancedCache<?,?> protected final org.infinispan.query.core.impl.PartitionHandlingSupportprotected final QueryDefinitionprotected final org.infinispan.query.core.stats.impl.LocalQueryStatistics -
Constructor Summary
ConstructorsConstructorDescriptionIndexedQueryImpl(String queryString, org.infinispan.objectfilter.impl.syntax.parser.IckleParsingResult.StatementType statementType, org.infinispan.query.dsl.embedded.impl.SearchQueryBuilder searchQuery, AdvancedCache<?, ?> cache, org.infinispan.query.core.stats.impl.LocalQueryStatistics queryStatistics, int defaultMaxResults) Create a IndexedQueryImpl based on a SearchQuery.IndexedQueryImpl(QueryDefinition queryDefinition, AdvancedCache<?, ?> cache, org.infinispan.query.core.stats.impl.LocalQueryStatistics queryStatistics) -
Method Summary
Modifier and TypeMethodDescriptionQueryResult<?><K> CloseableIterator<Map.Entry<K,E>> Returns the matching entries (both key and value).QueryResult<?>execute()Executes an Ickle statement returning results (query aka.intExecutes an Ickle statement not returning any results (ie.firstResult(int firstResult) Sets the result of the given integer value to the first result.inthitCountAccuracy(int hitCountAccuracy) Limit the required accuracy of the hit count for the indexed queries to an upper-bound.iterator()maxResults(int maxResults) Sets the maximum number of results to return from the query.Set the timeout for this query.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.query.impl.IndexedQuery
list
-
Field Details
-
cache
-
partitionHandlingSupport
protected final org.infinispan.query.core.impl.PartitionHandlingSupport partitionHandlingSupport -
queryDefinition
-
queryStatistics
protected final org.infinispan.query.core.stats.impl.LocalQueryStatistics queryStatistics
-
-
Constructor Details
-
IndexedQueryImpl
public IndexedQueryImpl(QueryDefinition queryDefinition, AdvancedCache<?, ?> cache, org.infinispan.query.core.stats.impl.LocalQueryStatistics queryStatistics) -
IndexedQueryImpl
public IndexedQueryImpl(String queryString, org.infinispan.objectfilter.impl.syntax.parser.IckleParsingResult.StatementType statementType, org.infinispan.query.dsl.embedded.impl.SearchQueryBuilder searchQuery, AdvancedCache<?, ?> cache, org.infinispan.query.core.stats.impl.LocalQueryStatistics queryStatistics, int defaultMaxResults) Create a IndexedQueryImpl based on a SearchQuery.
-
-
Method Details
-
getResultSize
public int getResultSize()- Specified by:
getResultSizein interfaceIndexedQuery<E>- Returns:
- The result size of the query.
-
firstResult
Sets the result of the given integer value to the first result.- Specified by:
firstResultin interfaceIndexedQuery<E>- Parameters:
firstResult- index to be set.- Throws:
IllegalArgumentException- if the index given is less than zero.
-
maxResults
Description copied from interface:IndexedQuerySets the maximum number of results to return from the query. Used for pagination.- Specified by:
maxResultsin interfaceIndexedQuery<E>- Parameters:
maxResults- the maximum number of results to return.
-
hitCountAccuracy
Description copied from interface:IndexedQueryLimit the required accuracy of the hit count for the indexed queries to an upper-bound. Setting the hit-count-accuracy could improve the performance of queries targeting large data sets.- Specified by:
hitCountAccuracyin interfaceIndexedQuery<E>- Parameters:
hitCountAccuracy- The value to apply- Returns:
this, for method chaining
-
iterator
- Specified by:
iteratorin interfaceIndexedQuery<E>- Throws:
org.hibernate.search.util.common.SearchException
-
entryIterator
Description copied from interface:IndexedQueryReturns the matching entries (both key and value).NOTE: The query must not contain any projections or an exception will be thrown.
- Specified by:
entryIteratorin interfaceIndexedQuery<E>
-
execute
Description copied from interface:IndexedQueryExecutes an Ickle statement returning results (query aka. SELECT). If the statement happens to be a DELETE it redirects it toIndexedQuery.executeStatement().NOTE: Paging params (firstResult/maxResults) are honoured for SELECT and dissalowed for DELETE.
- Specified by:
executein interfaceIndexedQuery<E>
-
aggregation
-
executeStatement
public int executeStatement()Description copied from interface:IndexedQueryExecutes an Ickle statement not returning any results (ie. DELETE).NOTE: Paging params (firstResult/maxResults) are NOT allowed.
- Specified by:
executeStatementin interfaceIndexedQuery<E>- Returns:
- the number of affected entries
-
timeout
Description copied from interface:IndexedQuerySet the timeout for this query. If the query hasn't finished processing before the timeout, an exception will be thrown.- Specified by:
timeoutin interfaceIndexedQuery<E>- Parameters:
timeout- the timeout durationtimeUnit- the time unit of the timeout parameter
-