public class GridCacheQueryAdapter<T> extends Object implements CacheQuery<T>
DFLT_PAGE_SIZE| Constructor and Description |
|---|
GridCacheQueryAdapter(GridCacheContext<?,?> cctx,
GridCacheQueryType type,
IgniteLogger log,
int pageSize,
long timeout,
boolean keepAll,
boolean incBackups,
boolean dedup,
ClusterGroup prj,
IgniteBiPredicate<Object,Object> filter,
String clsName,
String clause,
boolean incMeta,
boolean keepPortable,
UUID subjId,
int taskHash) |
GridCacheQueryAdapter(GridCacheContext<?,?> cctx,
GridCacheQueryType type,
String clsName,
String clause,
IgniteBiPredicate<Object,Object> filter,
boolean incMeta,
boolean keepPortable) |
| Modifier and Type | Method and Description |
|---|---|
String |
clause() |
boolean |
enableDedup() |
CacheQuery<T> |
enableDedup(boolean dedup)
Sets whether or not to deduplicate query result set.
|
<R> CacheQueryFuture<R> |
execute(IgniteClosure<T,R> rmtTransform,
Object... args)
Executes the query the same way as
CacheQuery.execute(Object...) method but transforms result remotely. |
<R> CacheQueryFuture<R> |
execute(IgniteReducer<T,R> rmtReducer,
Object... args)
Executes the query the same way as
CacheQuery.execute(Object...) method but reduces result remotely. |
CacheQueryFuture<T> |
execute(Object... args)
Executes the query and returns the query future.
|
boolean |
includeBackups() |
CacheQuery<T> |
includeBackups(boolean incBackups)
Sets whether or not to include backup entries into query result.
|
boolean |
includeMetadata() |
boolean |
keepAll() |
CacheQuery<T> |
keepAll(boolean keepAll)
Sets whether or not to keep all query results local.
|
boolean |
keepPortable() |
void |
keepPortable(boolean keepPortable)
Forces query to keep portable object representation even if query was created on plain projection.
|
QueryMetrics |
metrics()
Gets metrics for this query.
|
void |
onExecuted(Object res,
Throwable err,
long startTime,
long duration) |
int |
pageSize() |
CacheQuery<T> |
pageSize(int pageSize)
Sets result page size.
|
ClusterGroup |
projection() |
CacheQuery<T> |
projection(ClusterGroup prj)
Sets optional grid projection to execute this query on.
|
String |
queryClassName() |
void |
resetMetrics()
Resets metrics for this query.
|
<K,V> IgniteBiPredicate<K,V> |
scanFilter() |
UUID |
subjectId() |
void |
subjectId(UUID subjId) |
int |
taskHash() |
long |
timeout() |
CacheQuery<T> |
timeout(long timeout)
Sets query timeout.
|
String |
toString() |
GridCacheQueryType |
type() |
void |
validate() |
public GridCacheQueryAdapter(GridCacheContext<?,?> cctx, GridCacheQueryType type, @Nullable String clsName, @Nullable String clause, @Nullable IgniteBiPredicate<Object,Object> filter, boolean incMeta, boolean keepPortable)
cctx - Context.type - Query type.clsName - Class name.clause - Clause.filter - Scan filter.incMeta - Include metadata flag.keepPortable - Keep portable flag.public GridCacheQueryAdapter(GridCacheContext<?,?> cctx, GridCacheQueryType type, IgniteLogger log, int pageSize, long timeout, boolean keepAll, boolean incBackups, boolean dedup, ClusterGroup prj, IgniteBiPredicate<Object,Object> filter, @Nullable String clsName, String clause, boolean incMeta, boolean keepPortable, UUID subjId, int taskHash)
cctx - Context.prjPred - Cache projection filter.type - Query type.log - Logger.pageSize - Page size.timeout - Timeout.keepAll - Keep all flag.incBackups - Include backups flag.dedup - Enable dedup flag.prj - Grid projection.filter - Key-value filter.clsName - Class name.clause - Clause.incMeta - Include metadata flag.keepPortable - Keep portable flag.subjId - Security subject ID.taskHash - Task hash.public GridCacheQueryType type()
public boolean includeMetadata()
public boolean keepPortable()
True if portable should not be deserialized.public void keepPortable(boolean keepPortable)
keepPortable - Keep portable flag.public UUID subjectId()
public int taskHash()
public void subjectId(UUID subjId)
subjId - Security subject ID.public CacheQuery<T> pageSize(int pageSize)
CacheQuery.DFLT_PAGE_SIZE will be used.
Results are returned from queried nodes one page at a tme.pageSize in interface CacheQuery<T>pageSize - Page size.this query instance for chaining.public int pageSize()
public CacheQuery<T> timeout(long timeout)
0 means there is no timeout (this
is a default value).timeout in interface CacheQuery<T>timeout - Query timeout.this query instance for chaining.public long timeout()
public CacheQuery<T> keepAll(boolean keepAll)
true.keepAll in interface CacheQuery<T>keepAll - Keep results or not.this query instance for chaining.public boolean keepAll()
public CacheQuery<T> includeBackups(boolean incBackups)
false by default.includeBackups in interface CacheQuery<T>incBackups - Query includeBackups flag.this query instance for chaining.public boolean includeBackups()
public CacheQuery<T> enableDedup(boolean dedup)
true
then query result will not contain some key more than once even if several nodes
returned entries with the same keys. Default value is false.enableDedup in interface CacheQuery<T>dedup - Query enableDedup flag.this query instance for chaining.public boolean enableDedup()
public CacheQuery<T> projection(ClusterGroup prj)
projection in interface CacheQuery<T>prj - Projection.this query instance for chaining.public ClusterGroup projection()
@Nullable public <K,V> IgniteBiPredicate<K,V> scanFilter()
public void validate()
throws IgniteCheckedException
IgniteCheckedException - If query is invalid.public void onExecuted(Object res, Throwable err, long startTime, long duration)
res - Query result.err - Error or null if query executed successfully.startTime - Start time.duration - Duration.public CacheQueryFuture<T> execute(@Nullable Object... args)
'get(..)' methods on the returned future. If
CacheQuery.keepAll(boolean) flag is set to false, then 'get(..)'
methods will only return the last page received, otherwise all pages will be
accumulated and returned to user as a collection.
Note that if the passed in grid projection is a local node, then query will be executed locally without distribution to other nodes.
Also note that query state cannot be changed (clause, timeout etc.), except arguments, if this method was called at least once.
execute in interface CacheQuery<T>args - Optional arguments.public <R> CacheQueryFuture<R> execute(IgniteReducer<T,R> rmtReducer, @Nullable Object... args)
CacheQuery.execute(Object...) method but reduces result remotely.execute in interface CacheQuery<T>rmtReducer - Remote reducer.args - Optional arguments.public <R> CacheQueryFuture<R> execute(IgniteClosure<T,R> rmtTransform, @Nullable Object... args)
CacheQuery.execute(Object...) method but transforms result remotely.execute in interface CacheQuery<T>rmtTransform - Remote transformer.args - Optional arguments.public QueryMetrics metrics()
CacheQuerymetrics in interface CacheQuery<T>public void resetMetrics()
CacheQueryresetMetrics in interface CacheQuery<T>
Follow @ApacheIgnite
Ignite Fabric : ver. 1.0.0-RC3 Release Date : March 24 2015