public class QueryIndex extends Object implements Serializable
sorted
index
the list can be provided as following (id, name asc, age desc)
.Modifier and Type | Field and Description |
---|---|
static int |
DFLT_INLINE_SIZE
Default index inline size.
|
Constructor and Description |
---|
QueryIndex()
Creates an empty index.
|
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.
|
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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Collection<String> |
getFieldNames() |
LinkedHashMap<String,Boolean> |
getFields()
Gets fields included in the index.
|
QueryIndexType |
getIndexType()
Gets index type.
|
int |
getInlineSize()
Gets index inline size in bytes.
|
String |
getName()
Gets index name.
|
int |
hashCode() |
QueryIndex |
setFieldNames(Collection<String> fields,
boolean asc)
Sets a collection of field names altogether with the field sorting direction.
|
QueryIndex |
setFields(LinkedHashMap<String,Boolean> fields)
Sets fields included in the index.
|
QueryIndex |
setIndexType(QueryIndexType type)
Sets index type.
|
QueryIndex |
setInlineSize(int inlineSize)
Sets index inline size in bytes.
|
QueryIndex |
setName(String name)
Sets index name.
|
String |
toString() |
public static final int DFLT_INLINE_SIZE
public QueryIndex()
public QueryIndex(String field)
field
- Field name.public QueryIndex(String field, boolean asc)
field
- Field name.asc
- Ascending flag.public QueryIndex(String field, boolean asc, String name)
field
- Field name.asc
- Ascending flag.name
- Index name.public QueryIndex(String field, QueryIndexType type)
field
- Field name.type
- Index type.public QueryIndex(String field, QueryIndexType type, boolean asc)
field
- Field name.type
- Index type.asc
- Ascending flag.public QueryIndex(String field, QueryIndexType type, boolean asc, String name)
field
- Field name.type
- Index type.asc
- Ascending flag.name
- Index name.public QueryIndex(Collection<String> fields, QueryIndexType type)
fields
- Collection of fields to create an index.type
- Index type.public QueryIndex(LinkedHashMap<String,Boolean> fields, QueryIndexType type)
fields
- Field name to field sort direction for sorted indexes.type
- Index type.public String getName()
public QueryIndex setName(String name)
name
- Index name.this
for chaining.public LinkedHashMap<String,Boolean> getFields()
public QueryIndex setFields(LinkedHashMap<String,Boolean> fields)
fields
- Collection of index fields.this
for chaining.public Collection<String> getFieldNames()
public QueryIndex setFieldNames(Collection<String> fields, boolean asc)
fields
- Collection of fields.asc
- Ascending flag.this
for chaining.public QueryIndexType getIndexType()
public QueryIndex setIndexType(QueryIndexType type)
type
- Index type.this
for chaining.public int getInlineSize()
Allowed values:
-1
(default) - determine inline size automatically (see below)0
- index inline is disabled (not recommended)-1
, Ignite will try to detect inline size automatically. It will be no more than
CacheConfiguration.getSqlIndexMaxInlineSize()
. Index inline will be enabled for all fixed-length types,
but will not be enabled for String
.public QueryIndex setInlineSize(int inlineSize)
Allowed values:
-1
(default) - determine inline size automatically (see below)0
- index inline is disabled (not recommended)-1
, Ignite will try to detect inline size automatically. It will be no more than
CacheConfiguration.getSqlIndexMaxInlineSize()
. Index inline will be enabled for all fixed-length types,
but will not be enabled for String
.inlineSize
- Inline size.this
for chaining.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023