public final class SqlFieldsQuery extends Query<List<?>>
'select'
clause, as opposed to SqlQuery
, which always returns
the whole key and value objects back.
For example, in case of Word-Count example, we know that all identical words
are processed on the same cluster member, because we use the word
itself
as affinity key. This allows Ignite to execute the 'limit'
clause on
the remote nodes and bring back only the small data set specified within the 'limit' clause,
instead of the whole query result as would happen in a non-collocated execution.
IgniteCache.query(Query)
,
Serialized FormDFLT_PAGE_SIZE
Constructor and Description |
---|
SqlFieldsQuery(String sql)
Constructs SQL fields query.
|
SqlFieldsQuery(String sql,
boolean collocated)
Constructs SQL fields query.
|
Modifier and Type | Method and Description |
---|---|
Object[] |
getArgs()
Gets SQL arguments.
|
String |
getSql()
Gets SQL clause.
|
boolean |
isCollocated()
Checks if this query is collocated.
|
SqlFieldsQuery |
setArgs(Object... args)
Sets SQL arguments.
|
SqlFieldsQuery |
setCollocated(boolean collocated)
Sets flag defining if this query is collocated.
|
SqlFieldsQuery |
setLocal(boolean loc)
Sets whether this query should be executed on local node only.
|
SqlFieldsQuery |
setPageSize(int pageSize)
Sets optional page size, if
0 , then default is used. |
SqlFieldsQuery |
setSql(String sql)
Sets SQL clause.
|
String |
toString() |
getPageSize, isLocal
public SqlFieldsQuery(String sql)
sql
- SQL query.public SqlFieldsQuery(String sql, boolean collocated)
sql
- SQL query.collocated
- Collocated flag.public String getSql()
public SqlFieldsQuery setSql(String sql)
sql
- SQL clause.this
For chaining.public Object[] getArgs()
public SqlFieldsQuery setArgs(Object... args)
args
- SQL arguments.this
For chaining.public boolean isCollocated()
true
If the query is collocated.public SqlFieldsQuery setCollocated(boolean collocated)
collocated
- Flag value.this
For chaining.public SqlFieldsQuery setPageSize(int pageSize)
0
, then default is used.setPageSize
in class Query<List<?>>
pageSize
- Optional page size.this
for chaining.public SqlFieldsQuery setLocal(boolean loc)
Follow @ApacheIgnite
Ignite Fabric : ver. 1.1.0-incubating Release Date : May 20 2015