Class DistributedIndexedQueryImpl<E>

java.lang.Object
org.infinispan.query.impl.IndexedQueryImpl<E>
org.infinispan.query.clustered.DistributedIndexedQueryImpl<E>
All Implemented Interfaces:
IndexedQuery<E>

public final class DistributedIndexedQueryImpl<E> extends IndexedQueryImpl<E>
An extension of IndexedQueryImpl used for distributed queries.
Since:
5.1
Author:
Israel Lacerra <israeldl@gmail.com>
  • Constructor Details

    • DistributedIndexedQueryImpl

      public DistributedIndexedQueryImpl(QueryDefinition queryDefinition, org.infinispan.AdvancedCache<?,?> cache, org.infinispan.query.core.stats.impl.LocalQueryStatistics queryStatistics, int defaultMaxResults)
  • Method Details

    • maxResults

      public IndexedQuery<E> maxResults(int maxResults)
      Description copied from interface: IndexedQuery
      Sets the maximum number of results to return from the query. Used for pagination.
      Specified by:
      maxResults in interface IndexedQuery<E>
      Overrides:
      maxResults in class IndexedQueryImpl<E>
      Parameters:
      maxResults - the maximum number of results to return.
    • firstResult

      public IndexedQuery<E> firstResult(int firstResult)
      Description copied from class: IndexedQueryImpl
      Sets the result of the given integer value to the first result.
      Specified by:
      firstResult in interface IndexedQuery<E>
      Overrides:
      firstResult in class IndexedQueryImpl<E>
      Parameters:
      firstResult - index to be set.
    • getResultSize

      public int getResultSize()
      Specified by:
      getResultSize in interface IndexedQuery<E>
      Overrides:
      getResultSize in class IndexedQueryImpl<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:
      iterator in interface IndexedQuery<E>
      Overrides:
      iterator in class IndexedQueryImpl<E>
      Throws:
      org.hibernate.search.util.common.SearchException
    • entryIterator

      public <K> org.infinispan.commons.util.CloseableIterator<Map.Entry<K,E>> entryIterator()
      Description copied from interface: IndexedQuery
      Returns the matching entries (both key and value).

      NOTE: The query must not contain any projections or an exception will be thrown.

      Specified by:
      entryIterator in interface IndexedQuery<E>
      Overrides:
      entryIterator in class IndexedQueryImpl<E>
    • execute

      public org.infinispan.query.dsl.QueryResult<?> execute()
      Description copied from interface: IndexedQuery
      Executes an Ickle statement returning results (query aka. SELECT). If the statement happens to be a DELETE it redirects it to IndexedQuery.executeStatement().

      NOTE: Paging params (firstResult/maxResults) are honoured for SELECT and dissalowed for DELETE.

      Specified by:
      execute in interface IndexedQuery<E>
      Overrides:
      execute in class IndexedQueryImpl<E>
    • executeStatement

      public int executeStatement()
      Description copied from interface: IndexedQuery
      Executes an Ickle statement not returning any results (ie. DELETE).

      NOTE: Paging params (firstResult/maxResults) are NOT allowed.

      Specified by:
      executeStatement in interface IndexedQuery<E>
      Overrides:
      executeStatement in class IndexedQueryImpl<E>
      Returns:
      the number of affected entries
    • timeout

      public IndexedQuery<E> timeout(long timeout, TimeUnit timeUnit)
      Description copied from interface: IndexedQuery
      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 IndexedQuery<E>
      Overrides:
      timeout in class IndexedQueryImpl<E>
      Parameters:
      timeout - the timeout duration
      timeUnit - the time unit of the timeout parameter