public class GridCacheQueryAdapter<T> extends Object implements CacheQuery<T>
| Constructor and Description |
|---|
GridCacheQueryAdapter(GridCacheContext<?,?> cctx,
GridCacheQueryType type,
@Nullable IgniteBiPredicate<Object,Object> filter,
@Nullable IgniteClosure<Map.Entry,Object> transform,
@Nullable Integer part,
boolean keepBinary,
boolean forceLocal,
Boolean dataPageScanEnabled) |
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,
int limit,
boolean incMeta,
boolean keepBinary,
UUID subjId,
int taskHash,
MvccSnapshot mvccSnapshot,
Boolean dataPageScanEnabled) |
GridCacheQueryAdapter(GridCacheContext<?,?> cctx,
GridCacheQueryType type,
@Nullable String clsName,
@Nullable String clause,
@Nullable IgniteBiPredicate<Object,Object> filter,
@Nullable Integer part,
boolean incMeta,
boolean keepBinary,
Boolean dataPageScanEnabled) |
| Modifier and Type | Method and Description |
|---|---|
@Nullable 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 |
isDataPageScanEnabled() |
boolean |
keepBinary() |
void |
keepBinary(boolean keepBinary)
Forces query to keep binary object representation even if query was created on plain projection.
|
int |
limit() |
CacheQuery<T> |
limit(int limit)
Sets limit of returned records.
|
int |
pageSize() |
CacheQuery<T> |
pageSize(int pageSize)
Sets result page size.
|
@Nullable Integer |
partition() |
ClusterGroup |
projection() |
CacheQuery<T> |
projection(ClusterGroup prj)
Sets optional grid projection to execute this query on.
|
@Nullable String |
queryClassName() |
<K,V> @Nullable 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> @Nullable IgniteClosure<Map.Entry<K,V>,Object> |
transform() |
GridCacheQueryType |
type() |
void |
validate() |
public GridCacheQueryAdapter(GridCacheContext<?,?> cctx, GridCacheQueryType type, @Nullable @Nullable IgniteBiPredicate<Object,Object> filter, @Nullable @Nullable IgniteClosure<Map.Entry,Object> transform, @Nullable @Nullable Integer part, boolean keepBinary, boolean forceLocal, Boolean dataPageScanEnabled)
cctx - Context.type - Query type.filter - Scan filter.part - Partition.keepBinary - Keep binary flag.forceLocal - Flag to force local query.dataPageScanEnabled - Flag to enable data page scan.public GridCacheQueryAdapter(GridCacheContext<?,?> cctx, GridCacheQueryType type, @Nullable @Nullable String clsName, @Nullable @Nullable String clause, @Nullable @Nullable IgniteBiPredicate<Object,Object> filter, @Nullable @Nullable Integer part, boolean incMeta, boolean keepBinary, Boolean dataPageScanEnabled)
cctx - Context.type - Query type.clsName - Class name.clause - Clause.filter - Scan filter.part - Partition.incMeta - Include metadata flag.keepBinary - Keep binary flag.dataPageScanEnabled - Flag to enable data page scan.public GridCacheQueryAdapter(GridCacheContext<?,?> cctx, GridCacheQueryType type, IgniteLogger log, int pageSize, long timeout, boolean incBackups, boolean dedup, ClusterGroup prj, IgniteBiPredicate<Object,Object> filter, @Nullable @Nullable Integer part, @Nullable @Nullable String clsName, String clause, int limit, boolean incMeta, boolean keepBinary, UUID subjId, int taskHash, MvccSnapshot mvccSnapshot, Boolean dataPageScanEnabled)
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.limit - Response limit. Set to 0 for no limits.incMeta - Include metadata flag.keepBinary - Keep binary flag.subjId - Security subject ID.taskHash - Task hash.mvccSnapshot - Mvcc version.dataPageScanEnabled - Flag to enable data page scan.public Boolean isDataPageScanEnabled()
public GridCacheQueryType type()
@Nullable public @Nullable String queryClassName()
@Nullable public @Nullable 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 int limit()
public CacheQuery<T> limit(int limit)
0 means there is no limitlimit in interface CacheQuery<T>limit - Records limit.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> @Nullable IgniteBiPredicate<K,V> scanFilter()
@Nullable public <K,V> @Nullable IgniteClosure<Map.Entry<K,V>,Object> transform()
@Nullable public @Nullable 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 GridCloseableIterator executeScanQuery() throws IgniteCheckedException
executeScanQuery in interface CacheQuery<T>IgniteCheckedException
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.8.0 Release Date : February 27 2020