Package org.infinispan.query.clustered
Class DistributedIndexedQueryImpl<E>
java.lang.Object
org.infinispan.query.impl.IndexedQueryImpl<E>
org.infinispan.query.clustered.DistributedIndexedQueryImpl<E>
- All Implemented Interfaces:
IndexedQuery<E>
An extension of IndexedQueryImpl used for distributed queries.
- Since:
- 5.1
- Author:
- Israel Lacerra <israeldl@gmail.com>
-
Field Summary
Fields inherited from class org.infinispan.query.impl.IndexedQueryImpl
cache, partitionHandlingSupport, queryDefinition, queryStatistics -
Constructor Summary
ConstructorsConstructorDescriptionDistributedIndexedQueryImpl(QueryDefinition queryDefinition, org.infinispan.AdvancedCache<?, ?> cache, org.infinispan.query.core.stats.impl.LocalQueryStatistics queryStatistics, int defaultMaxResults, Integer knn) -
Method Summary
Modifier and TypeMethodDescription<K> org.infinispan.commons.util.CloseableIterator<org.infinispan.commons.api.query.EntityEntry<K, E>> Returns the matching entries (both key and value).org.infinispan.query.dsl.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.intorg.infinispan.commons.util.CloseableIterator<E> 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 org.infinispan.query.impl.IndexedQueryImpl
aggregation, hitCountAccuracy, scoreRequiredMethods 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
-
Constructor Details
-
DistributedIndexedQueryImpl
public DistributedIndexedQueryImpl(QueryDefinition queryDefinition, org.infinispan.AdvancedCache<?, ?> cache, org.infinispan.query.core.stats.impl.LocalQueryStatistics queryStatistics, int defaultMaxResults, Integer knn)
-
-
Method Details
-
maxResults
Description copied from interface:IndexedQuerySets the maximum number of results to return from the query. Used for pagination.- Specified by:
maxResultsin interfaceIndexedQuery<E>- Overrides:
maxResultsin classIndexedQueryImpl<E>- Parameters:
maxResults- the maximum number of results to return.
-
firstResult
Description copied from class:IndexedQueryImplSets the result of the given integer value to the first result.- Specified by:
firstResultin interfaceIndexedQuery<E>- Overrides:
firstResultin classIndexedQueryImpl<E>- Parameters:
firstResult- index to be set.
-
getResultSize
public int getResultSize()- Specified by:
getResultSizein interfaceIndexedQuery<E>- Overrides:
getResultSizein classIndexedQueryImpl<E>- Returns:
- The result size of the query.
-
iterator
public org.infinispan.commons.util.CloseableIterator<E> iterator() throws org.hibernate.search.util.common.SearchException- Specified by:
iteratorin interfaceIndexedQuery<E>- Overrides:
iteratorin classIndexedQueryImpl<E>- Throws:
org.hibernate.search.util.common.SearchException
-
entryIterator
public <K> org.infinispan.commons.util.CloseableIterator<org.infinispan.commons.api.query.EntityEntry<K,E>> 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>- Overrides:
entryIteratorin classIndexedQueryImpl<E>
-
execute
public org.infinispan.query.dsl.QueryResult<?> 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>- Overrides:
executein classIndexedQueryImpl<E>
-
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>- Overrides:
executeStatementin classIndexedQueryImpl<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>- Overrides:
timeoutin classIndexedQueryImpl<E>- Parameters:
timeout- the timeout durationtimeUnit- the time unit of the timeout parameter
-