public class GridCacheQueryAdapter<T> extends Object implements CacheQuery<T>
| Constructor and Description |
|---|
GridCacheQueryAdapter(GridCacheContext<?,?> cctx,
GridCacheQueryType type,
IgniteBiPredicate<Object,Object> filter,
IgniteClosure<Map.Entry,Object> transform,
Integer part,
boolean keepBinary,
boolean forceLocal) |
GridCacheQueryAdapter(GridCacheContext<?,?> cctx,
GridCacheQueryType type,
IgniteLogger log,
int pageSize,
long timeout,
boolean incBackups,
boolean dedup,
ClusterGroup prj,
IgniteBiPredicate<Object,Object> filter,
Integer part,
String clsName,
String clause,
boolean incMeta,
boolean keepBinary,
UUID subjId,
int taskHash,
MvccSnapshot mvccSnapshot) |
GridCacheQueryAdapter(GridCacheContext<?,?> cctx,
GridCacheQueryType type,
String clsName,
String clause,
IgniteBiPredicate<Object,Object> filter,
Integer part,
boolean incMeta,
boolean keepBinary) |
| 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(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.
|
GridCloseableIterator |
executeScanQuery() |
boolean |
forceLocal() |
boolean |
includeBackups() |
CacheQuery<T> |
includeBackups(boolean incBackups)
Sets whether or not to include backup entries into query result.
|
boolean |
includeMetadata() |
boolean |
keepBinary() |
void |
keepBinary(boolean keepBinary)
Forces query to keep binary object representation even if query was created on plain projection.
|
QueryMetrics |
metrics()
Gets metrics for this query.
|
int |
pageSize() |
CacheQuery<T> |
pageSize(int pageSize)
Sets result page size.
|
Integer |
partition() |
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() |
<K,V> IgniteClosure<Map.Entry<K,V>,Object> |
transform() |
GridCacheQueryType |
type() |
void |
validate() |
public GridCacheQueryAdapter(GridCacheContext<?,?> cctx, GridCacheQueryType type, @Nullable IgniteBiPredicate<Object,Object> filter, @Nullable IgniteClosure<Map.Entry,Object> transform, @Nullable Integer part, boolean keepBinary, boolean forceLocal)
cctx - Context.type - Query type.filter - Scan filter.part - Partition.keepBinary - Keep binary flag.forceLocal - Flag to force local query.public GridCacheQueryAdapter(GridCacheContext<?,?> cctx, GridCacheQueryType type, @Nullable String clsName, @Nullable String clause, @Nullable IgniteBiPredicate<Object,Object> filter, @Nullable Integer part, boolean incMeta, boolean keepBinary)
cctx - Context.type - Query type.clsName - Class name.clause - Clause.filter - Scan filter.part - Partition.incMeta - Include metadata flag.keepBinary - Keep binary flag.public GridCacheQueryAdapter(GridCacheContext<?,?> cctx, GridCacheQueryType type, IgniteLogger log, int pageSize, long timeout, boolean incBackups, boolean dedup, ClusterGroup prj, IgniteBiPredicate<Object,Object> filter, @Nullable Integer part, @Nullable String clsName, String clause, boolean incMeta, boolean keepBinary, UUID subjId, int taskHash, MvccSnapshot mvccSnapshot)
cctx - Context.type - Query type.log - Logger.pageSize - Page size.timeout - Timeout.incBackups - Include backups flag.dedup - Enable dedup flag.prj - Grid projection.filter - Key-value filter.part - Partition.clsName - Class name.clause - Clause.incMeta - Include metadata flag.keepBinary - Keep binary flag.subjId - Security subject ID.taskHash - Task hash.mvccSnapshot - Mvcc version.public GridCacheQueryType type()
@Nullable public String queryClassName()
@Nullable public String clause()
public boolean includeMetadata()
public boolean keepBinary()
True if binary should not be deserialized.public void keepBinary(boolean keepBinary)
keepBinary - Keep binary flag.public boolean forceLocal()
True if the query is forced local.public UUID subjectId()
public int taskHash()
public void subjectId(UUID subjId)
subjId - Security subject ID.public CacheQuery<T> pageSize(int pageSize)
Query.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> 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()
@Nullable public <K,V> IgniteClosure<Map.Entry<K,V>,Object> transform()
@Nullable public Integer partition()
public void validate()
throws IgniteCheckedException
IgniteCheckedException - If query is invalid.public CacheQueryFuture<T> execute(@Nullable Object... args)
'get(..)' methods on the returned future.
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 QueryMetrics metrics()
metrics in interface CacheQuery<T>public void resetMetrics()
resetMetrics in interface CacheQuery<T>public GridCloseableIterator executeScanQuery() throws IgniteCheckedException
executeScanQuery in interface CacheQuery<T>IgniteCheckedException
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.5 Release Date : June 4 2019