Class BaseEmbeddedQuery<T>

java.lang.Object
org.infinispan.commons.query.BaseQuery<T>
org.infinispan.query.core.impl.BaseEmbeddedQuery<T>
All Implemented Interfaces:
Iterable<T>, org.infinispan.commons.api.query.Query<T>, org.infinispan.query.dsl.Query<T>
Direct Known Subclasses:
EmbeddedQuery, EmptyResultQuery, HybridQuery

public abstract class BaseEmbeddedQuery<T> extends org.infinispan.commons.query.BaseQuery<T>
Base class for embedded-mode query implementations. Subclasses need to implement getInternalIterator() and getComparator() methods and this class will take care of sorting (fully in-memory).
Since:
8.0
Author:
anistor@redhat.com
  • Field Details

    • statementType

      protected final org.infinispan.query.objectfilter.impl.syntax.parser.IckleParsingResult.StatementType statementType
    • cache

      protected final org.infinispan.AdvancedCache<?,?> cache
    • partitionHandlingSupport

      protected final PartitionHandlingSupport partitionHandlingSupport
    • queryStatistics

      protected final LocalQueryStatistics queryStatistics
  • Constructor Details

    • BaseEmbeddedQuery

      protected BaseEmbeddedQuery(org.infinispan.AdvancedCache<?,?> cache, String queryString, org.infinispan.query.objectfilter.impl.syntax.parser.IckleParsingResult.StatementType statementType, Map<String,Object> namedParameters, String[] projection, long startOffset, int maxResults, LocalQueryStatistics queryStatistics, boolean local)
  • Method Details

    • resetQuery

      public void resetQuery()
      Specified by:
      resetQuery in class org.infinispan.commons.query.BaseQuery<T>
    • list

      public List<T> list()
    • recordQuery

      protected abstract void recordQuery(long time)
    • execute

      public org.infinispan.query.dsl.QueryResult<T> execute()
    • executeAsync

      public CompletionStage<org.infinispan.commons.api.query.QueryResult<T>> executeAsync()
    • executeStatementAsync

      public CompletionStage<Integer> executeStatementAsync()
    • iterator

      public org.infinispan.commons.util.CloseableIterator<T> iterator()
    • getComparator

      protected abstract Comparator<Comparable<?>[]> getComparator()
      Create a comparator to be used for ordering the results returned by getInternalIterator().
      Returns:
      the comparator or null if no sorting needs to be applied
    • getInternalIterator

      protected abstract org.infinispan.commons.api.query.ClosableIteratorWithCount<ObjectFilter.FilterResult> getInternalIterator()
      Create an iterator over the results of the query, in no particular order. Ordering will be provided if getComparator() returns a non-null Comparator. Please note this it not the same iterator as the one retuend by iterator().
    • getResultSize

      public int getResultSize()
    • isSelectStatement

      protected boolean isSelectStatement()
    • toString

      public String toString()
      Overrides:
      toString in class Object