public final class IndexQuery<K,V> extends Query<javax.cache.Cache.Entry<K,V>>
QueryCursor
delivers sorted cache entries by the order defined for queried index.
IndexQuery
has to be initialized with cache value class or type. The algorithm of discovering index is as follows:
1. If idxName
is set, then use it.
2. If idxName
is not set, then find an index that matches criteria fields.
3. If neither idxName
, nor setCriteria(List)
is used, then perform index scan over PK index for specified Value type.
Conjuction of items in criteria
has to represent a valid range to traverse the index tree.DFLT_PAGE_SIZE
Constructor and Description |
---|
IndexQuery(Class<?> valCls)
Specify index with cache value class.
|
IndexQuery(Class<?> valCls,
@Nullable String idxName)
Specify index with cache value class and index name.
|
IndexQuery(String valType)
Specify index with cache value type.
|
IndexQuery(String valType,
@Nullable String idxName)
Specify index with cache value type and index name.
|
Modifier and Type | Method and Description |
---|---|
List<IndexQueryCriterion> |
getCriteria()
Index query criteria.
|
IgniteBiPredicate<K,V> |
getFilter()
Gets remote cache entries filter.
|
String |
getIndexName()
Index name.
|
String |
getValueType()
Cache Value type.
|
IndexQuery<K,V> |
setCriteria(IndexQueryCriterion... criteria)
Sets conjunction (AND) criteria for index query.
|
IndexQuery<K,V> |
setCriteria(List<IndexQueryCriterion> criteria)
Sets conjunction (AND) criteria for index query.
|
IndexQuery<K,V> |
setFilter(IgniteBiPredicate<K,V> filter)
Sets remote cache entries filter.
|
getPageSize, isLocal, prepare, setLocal, setPageSize, toString
public IndexQuery(Class<?> valCls)
valCls
- Cache value class.public IndexQuery(String valType)
valType
- Cache value type.public IndexQuery(Class<?> valCls, @Nullable @Nullable String idxName)
valCls
- Cache value class.idxName
- Index name.public IndexQuery<K,V> setCriteria(IndexQueryCriterion... criteria)
criteria
- Criteria to set.this
for chaining.public IndexQuery<K,V> setCriteria(List<IndexQueryCriterion> criteria)
criteria
- Criteria to set.this
for chaining.public List<IndexQueryCriterion> getCriteria()
public String getValueType()
public String getIndexName()
public IndexQuery<K,V> setFilter(IgniteBiPredicate<K,V> filter)
filter
- Predicate for remote filtering of query result cursor.this
for chaining.public IgniteBiPredicate<K,V> getFilter()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.12.0 Release Date : January 10 2022