Class HybridQuery<T,S>
java.lang.Object
org.infinispan.commons.query.BaseQuery<T>
org.infinispan.query.core.impl.BaseEmbeddedQuery<T>
org.infinispan.query.core.impl.HybridQuery<T,S>
- All Implemented Interfaces:
Iterable<T>, org.infinispan.commons.api.query.Query<T>, org.infinispan.query.dsl.Query<T>
- Direct Known Subclasses:
AggregatingQuery, MetadataHybridQuery
A non-indexed query performed on top of the results returned by another query (usually a Lucene based query). This
mechanism is used to implement hybrid two-stage queries that perform an index query using a partial query using only
the indexed fields and then filter the result again in memory with the full filter.
- Since:
- 8.0
- Author:
- anistor@redhat.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.infinispan.commons.api.query.Query<S> protected final ObjectFilterFields inherited from class BaseEmbeddedQuery
cache, partitionHandlingSupport, queryStatistics, statementTypeFields inherited from class org.infinispan.commons.query.BaseQuery
hitCountAccuracy, local, maxResults, namedParameters, projection, queryString, scoreRequired, startOffset, timeout -
Constructor Summary
ConstructorsConstructorDescriptionHybridQuery(org.infinispan.AdvancedCache<?, ?> cache, String queryString, org.infinispan.query.objectfilter.impl.syntax.parser.IckleParsingResult.StatementType statementType, Map<String, Object> namedParameters, ObjectFilter objectFilter, long startOffset, int maxResults, org.infinispan.commons.api.query.Query<?> baseQuery, LocalQueryStatistics queryStatistics, boolean local, boolean allSortFieldsAreStored) -
Method Summary
Modifier and TypeMethodDescriptionorg.infinispan.query.dsl.QueryResult<T> execute()intprotected org.infinispan.commons.util.CloseableIterator<?> protected Comparator<Comparable<?>[]> Create a comparator to be used for ordering the results returned byBaseEmbeddedQuery.getInternalIterator().protected org.infinispan.commons.api.query.ClosableIteratorWithCount<ObjectFilter.FilterResult> Create an iterator over the results of the query, in no particular order.protected intprotected voidrecordQuery(long time) toString()Methods inherited from class BaseEmbeddedQuery
executeAsync, executeStatementAsync, getResultSize, isSelectStatement, iterator, list, resetQueryMethods inherited from class org.infinispan.commons.query.BaseQuery
entryIterator, getMaxResults, getParameters, getProjection, getQueryString, getStartOffset, hasProjections, hitCountAccuracy, hitCountAccuracy, isLocal, local, maxResults, scoreRequired, setParameter, setParameters, startOffset, timeout, validateNamedParametersMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface org.infinispan.commons.api.query.Query
entryIterator, publish
-
Field Details
-
objectFilter
-
baseQuery
-
-
Constructor Details
-
HybridQuery
public HybridQuery(org.infinispan.AdvancedCache<?, ?> cache, String queryString, org.infinispan.query.objectfilter.impl.syntax.parser.IckleParsingResult.StatementType statementType, Map<String, Object> namedParameters, ObjectFilter objectFilter, long startOffset, int maxResults, org.infinispan.commons.api.query.Query<?> baseQuery, LocalQueryStatistics queryStatistics, boolean local, boolean allSortFieldsAreStored)
-
-
Method Details
-
recordQuery
protected void recordQuery(long time) - Specified by:
recordQueryin classBaseEmbeddedQuery<T>
-
getComparator
Description copied from class:BaseEmbeddedQueryCreate a comparator to be used for ordering the results returned byBaseEmbeddedQuery.getInternalIterator().- Specified by:
getComparatorin classBaseEmbeddedQuery<T>- Returns:
- the comparator or
nullif no sorting needs to be applied
-
getInternalIterator
protected org.infinispan.commons.api.query.ClosableIteratorWithCount<ObjectFilter.FilterResult> getInternalIterator()Description copied from class:BaseEmbeddedQueryCreate an iterator over the results of the query, in no particular order. Ordering will be provided ifBaseEmbeddedQuery.getComparator()returns a non-nullComparator. Please note this it not the same iterator as the one retuend byBaseEmbeddedQuery.iterator().- Specified by:
getInternalIteratorin classBaseEmbeddedQuery<T>
-
getBaseIterator
protected org.infinispan.commons.util.CloseableIterator<?> getBaseIterator() -
hybridMaxResult
protected int hybridMaxResult() -
execute
-
executeStatement
-
toString
- Overrides:
toStringin classBaseEmbeddedQuery<T>
-