Package org.apache.ignite.cache
Class QueryIndex
- java.lang.Object
- 
- org.apache.ignite.cache.QueryIndex
 
- 
- All Implemented Interfaces:
- Serializable
 
 public class QueryIndex extends Object implements Serializable Contains list of fields to be indexed. It is possible to provide field name suffixed with index specific extension, for example forsortedindex the list can be provided as following(id, name asc, age desc).- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static intDFLT_INLINE_SIZEDefault index inline size.
 - 
Constructor SummaryConstructors Constructor Description QueryIndex()Creates an empty index.QueryIndex(String field)Creates single-field sorted ascending index.QueryIndex(String field, boolean asc)Creates single-field sorted index.QueryIndex(String field, boolean asc, String name)Creates single-field sorted index.QueryIndex(String field, QueryIndexType type)Creates index for one field.QueryIndex(String field, QueryIndexType type, boolean asc)Creates index for one field.QueryIndex(String field, QueryIndexType type, boolean asc, String name)Creates index for one field.QueryIndex(Collection<String> fields, QueryIndexType type)Creates index for a collection of fields.QueryIndex(LinkedHashMap<String,Boolean> fields, QueryIndexType type)Creates index for a collection of fields.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Collection<String>getFieldNames()LinkedHashMap<String,Boolean>getFields()Gets fields included in the index.QueryIndexTypegetIndexType()Gets index type.intgetInlineSize()Gets index inline size in bytes.StringgetName()Gets index name.inthashCode()QueryIndexsetFieldNames(Collection<String> fields, boolean asc)Sets a collection of field names altogether with the field sorting direction.QueryIndexsetFields(LinkedHashMap<String,Boolean> fields)Sets fields included in the index.QueryIndexsetIndexType(QueryIndexType type)Sets index type.QueryIndexsetInlineSize(int inlineSize)Sets index inline size in bytes.QueryIndexsetName(String name)Sets index name.StringtoString()
 
- 
- 
- 
Field Detail- 
DFLT_INLINE_SIZEpublic static final int DFLT_INLINE_SIZE Default index inline size.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
QueryIndexpublic QueryIndex() Creates an empty index. Should be populated via setters.
 - 
QueryIndexpublic QueryIndex(String field) Creates single-field sorted ascending index.- Parameters:
- field- Field name.
 
 - 
QueryIndexpublic QueryIndex(String field, boolean asc) Creates single-field sorted index.- Parameters:
- field- Field name.
- asc- Ascending flag.
 
 - 
QueryIndexpublic QueryIndex(String field, boolean asc, String name) Creates single-field sorted index.- Parameters:
- field- Field name.
- asc- Ascending flag.
- name- Index name.
 
 - 
QueryIndexpublic QueryIndex(String field, QueryIndexType type) Creates index for one field. If index is sorted, then ascending sorting is used by default. To specify sort order, use the next method. This constructor should also have a corresponding setter method.- Parameters:
- field- Field name.
- type- Index type.
 
 - 
QueryIndexpublic QueryIndex(String field, QueryIndexType type, boolean asc) Creates index for one field. The last boolean parameter is ignored for non-sorted indexes.- Parameters:
- field- Field name.
- type- Index type.
- asc- Ascending flag.
 
 - 
QueryIndexpublic QueryIndex(String field, QueryIndexType type, boolean asc, String name) Creates index for one field. The last boolean parameter is ignored for non-sorted indexes.- Parameters:
- field- Field name.
- type- Index type.
- asc- Ascending flag.
- name- Index name.
 
 - 
QueryIndexpublic QueryIndex(Collection<String> fields, QueryIndexType type) Creates index for a collection of fields. If index is sorted, fields will be sorted in ascending order.- Parameters:
- fields- Collection of fields to create an index.
- type- Index type.
 
 - 
QueryIndexpublic QueryIndex(LinkedHashMap<String,Boolean> fields, QueryIndexType type) Creates index for a collection of fields. The order of fields in the created index will be the same as iteration order in the passed map. Map value defines whether the index will be ascending.- Parameters:
- fields- Field name to field sort direction for sorted indexes.
- type- Index type.
 
 
- 
 - 
Method Detail- 
getNamepublic String getName() Gets index name. Will be automatically set if not provided by a user.- Returns:
- Index name.
 
 - 
setNamepublic QueryIndex setName(String name) Sets index name.- Parameters:
- name- Index name.
- Returns:
- thisfor chaining.
 
 - 
getFieldspublic LinkedHashMap<String,Boolean> getFields() Gets fields included in the index.- Returns:
- Collection of index fields.
 
 - 
setFieldspublic QueryIndex setFields(LinkedHashMap<String,Boolean> fields) Sets fields included in the index.- Parameters:
- fields- Collection of index fields.
- Returns:
- thisfor chaining.
 
 - 
getFieldNamespublic Collection<String> getFieldNames() - Returns:
- Gets a collection of field names.
 
 - 
setFieldNamespublic QueryIndex setFieldNames(Collection<String> fields, boolean asc) Sets a collection of field names altogether with the field sorting direction. Sorting direction will be ignored for non-sorted indexes.- Parameters:
- fields- Collection of fields.
- asc- Ascending flag.
- Returns:
- thisfor chaining.
 
 - 
getIndexTypepublic QueryIndexType getIndexType() Gets index type.- Returns:
- Index type.
 
 - 
setIndexTypepublic QueryIndex setIndexType(QueryIndexType type) Sets index type.- Parameters:
- type- Index type.
- Returns:
- thisfor chaining.
 
 - 
getInlineSizepublic int getInlineSize() Gets index inline size in bytes. When enabled part of indexed value will be placed directly to index pages, thus minimizing data page accesses, thus increasing query performance.Allowed values: - -1(default) - determine inline size automatically (see below)
- 0- index inline is disabled (not recommended)
- positive value - fixed index inline
 -1, Ignite will try to detect inline size automatically. It will be no more thanCacheConfiguration.getSqlIndexMaxInlineSize(). Index inline will be enabled for all fixed-length types, but will not be enabled forString.- Returns:
- Index inline size in bytes.
 
 - 
setInlineSizepublic QueryIndex setInlineSize(int inlineSize) Sets index inline size in bytes. When enabled part of indexed value will be placed directly to index pages, thus minimizing data page accesses, thus increasing query performance.Allowed values: - -1(default) - determine inline size automatically (see below)
- 0- index inline is disabled (not recommended)
- positive value - fixed index inline
 -1, Ignite will try to detect inline size automatically. It will be no more thanCacheConfiguration.getSqlIndexMaxInlineSize(). Index inline will be enabled for all fixed-length types, but will not be enabled forString.- Parameters:
- inlineSize- Inline size.
- Returns:
- thisfor chaining.
 
 
- 
 
-