Class IndexedQueryImpl<E>

  • All Implemented Interfaces:

    public class IndexedQueryImpl<E>
    extends Object
    implements IndexedQuery<E>
    Lucene based indexed query implementation.
    Navin Surtani, Sanne Grinovero <> (C) 2011 Red Hat Inc., Marko Luksa
    • Field Detail

      • partitionHandlingSupport

        protected final org.infinispan.query.core.impl.PartitionHandlingSupport partitionHandlingSupport
      • queryStatistics

        protected final org.infinispan.query.core.stats.impl.LocalQueryStatistics queryStatistics
    • Constructor Detail

      • 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 Detail

      • getResultSize

        public int getResultSize()
        Specified by:
        getResultSize in interface IndexedQuery<E>
        The result size of the query.
      • firstResult

        public IndexedQuery<E> firstResult​(int firstResult)
        Sets the result of the given integer value to the first result.
        Specified by:
        firstResult in interface IndexedQuery<E>
        firstResult - index to be set.
        IllegalArgumentException - if the index given is less than zero.
      • 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>
        maxResults - the maximum number of results to return.
      • iterator

        public CloseableIterator<E> iterator()
        Specified by:
        iterator in interface IndexedQuery<E>
      • execute

        public 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>
      • 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>
        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>
        timeout - the timeout duration
        timeUnit - the time unit of the timeout parameter