public abstract class GridCacheQueryManager<K,V> extends GridCacheManagerAdapter<K,V>
| Modifier and Type | Class and Description |
|---|---|
static class |
GridCacheQueryManager.CacheSqlIndexMetadata
Cache metadata index.
|
static class |
GridCacheQueryManager.CacheSqlMetadata
Cache metadata.
|
static class |
GridCacheQueryManager.QueryResult<K,V> |
class |
GridCacheQueryManager.RequestFutureMap
The map prevents put to the map in case the specified request has been removed previously.
|
static class |
GridCacheQueryManager.ScanQueryIterator<K,V> |
cctx, log, starting| Constructor and Description |
|---|
GridCacheQueryManager() |
| Modifier and Type | Method and Description |
|---|---|
String |
cacheName()
FOR TESTING ONLY
|
void |
collectMetrics(GridCacheQueryType qryType,
String qry,
long startTime,
long duration,
boolean failed) |
CacheQuery<Map.Entry<K,V>> |
createFullTextQuery(String clsName,
String search,
int limit,
boolean keepBinary)
Creates user's full text query, queried class, and query clause.
|
<T,R> CacheQuery<R> |
createScanQuery(@Nullable IgniteBiPredicate<K,V> filter,
@Nullable IgniteClosure<T,R> trans,
@Nullable Integer part,
boolean keepBinary,
boolean forceLocal,
Boolean dataPageScanEnabled)
Creates user's predicate based scan query.
|
<R> CacheQuery<R> |
createScanQuery(@Nullable IgniteBiPredicate<K,V> filter,
@Nullable Integer part,
boolean keepBinary,
Boolean dataPageScanEnabled)
Creates user's predicate based scan query.
|
<R> CacheQuery<R> |
createSpiQuery(boolean keepBinary)
Query for
IndexingSpi. |
Collection<GridCacheQueryDetailMetricsAdapter> |
detailMetrics()
Gets cache queries detailed metrics.
|
void |
enable()
Enable query manager.
|
boolean |
enabled() |
void |
evictDetailMetrics()
Evict detail metrics.
|
abstract void |
loadPage(long id,
GridCacheQueryAdapter<?> qry,
Collection<ClusterNode> nodes,
boolean all)
Loads page.
|
GridConcurrentHashSet<GridCacheQueryManager.ScanQueryIterator> |
localQueryIterators() |
QueryMetrics |
metrics()
Gets cache queries metrics.
|
protected abstract boolean |
onFieldsPageReady(boolean loc,
org.apache.ignite.internal.processors.cache.query.GridCacheQueryInfo qryInfo,
@Nullable List<GridQueryFieldMetadata> metaData,
@Nullable Collection<?> entities,
@Nullable Collection<?> data,
boolean finished,
@Nullable Throwable e) |
protected void |
onKernalStop0(boolean cancel) |
protected abstract boolean |
onPageReady(boolean loc,
org.apache.ignite.internal.processors.cache.query.GridCacheQueryInfo qryInfo,
@Nullable Collection<?> data,
boolean finished,
@Nullable Throwable e)
Called when data for page is ready.
|
void |
printMemoryStats()
Prints memory statistics for debugging purposes.
|
abstract CacheQueryFuture<?> |
queryDistributed(GridCacheQueryBean qry,
Collection<ClusterNode> nodes)
Executes distributed query.
|
abstract CacheQueryFuture<?> |
queryFieldsDistributed(GridCacheQueryBean qry,
Collection<ClusterNode> nodes)
Executes distributed fields query.
|
abstract CacheQueryFuture<?> |
queryFieldsLocal(GridCacheQueryBean qry)
Executes distributed fields query.
|
ConcurrentMap<UUID,GridCacheQueryManager.RequestFutureMap> |
queryIterators() |
AffinityTopologyVersion |
queryTopologyVersion() |
void |
remove(KeyCacheObject key,
@Nullable CacheDataRow prevRow) |
protected void |
removeFieldsQueryResult(@Nullable UUID sndId,
long reqId) |
void |
removeQueryResult(@Nullable UUID sndId,
long reqId) |
void |
resetDetailMetrics()
Resets detail metrics.
|
void |
resetMetrics()
Resets metrics.
|
protected void |
runFieldsQuery(org.apache.ignite.internal.processors.cache.query.GridCacheQueryInfo qryInfo)
Processes fields query request.
|
protected void |
runQuery(org.apache.ignite.internal.processors.cache.query.GridCacheQueryInfo qryInfo)
Processes cache query request.
|
abstract GridCloseableIterator |
scanQueryDistributed(GridCacheQueryAdapter qry,
Collection<ClusterNode> nodes)
Executes distributed SCAN query.
|
protected GridCloseableIterator |
scanQueryLocal(GridCacheQueryAdapter qry,
boolean updateStatistics)
Process local scan query.
|
Collection<GridCacheSqlMetadata> |
sqlMetadata()
Gets SQL metadata.
|
Collection<GridCacheSqlMetadata> |
sqlMetadataV2()
Gets SQL metadata with not nulls fields.
|
void |
start0() |
void |
stop0(boolean cancel,
boolean destroy)
Stops query manager.
|
void |
store(CacheDataRow newRow,
@Nullable CacheDataRow prevRow,
boolean prevRowAvailable) |
context, kernalStartInfo, kernalStopInfo, log, onDisconnected, onKernalStart, onKernalStart0, onKernalStop, start, startInfo, stop, stopInfo, toStringpublic void start0()
throws IgniteCheckedException
start0 in class GridCacheManagerAdapter<K,V>IgniteCheckedException - If failed.public boolean enabled()
True if indexing is enabled for cache.public void enable()
protected void onKernalStop0(boolean cancel)
onKernalStop0 in class GridCacheManagerAdapter<K,V>cancel - Cancel flag.public final void stop0(boolean cancel,
boolean destroy)
stop0 in class GridCacheManagerAdapter<K,V>cancel - Cancel queries.destroy - Cache destroy flag..public void store(CacheDataRow newRow, @Nullable @Nullable CacheDataRow prevRow, boolean prevRowAvailable) throws IgniteCheckedException
newRow - New row.prevRow - Previous row.prevRowAvailable - Whether previous row is available.IgniteCheckedException - In case of error.public void remove(KeyCacheObject key, @Nullable @Nullable CacheDataRow prevRow) throws IgniteCheckedException
key - Key.prevRow - Previous row.IgniteCheckedException - Thrown in case of any errors.public abstract CacheQueryFuture<?> queryDistributed(GridCacheQueryBean qry, Collection<ClusterNode> nodes)
qry - Query.nodes - Nodes.public abstract GridCloseableIterator scanQueryDistributed(GridCacheQueryAdapter qry, Collection<ClusterNode> nodes) throws IgniteCheckedException
qry - Query.nodes - Nodes.IgniteCheckedException - If failed.public abstract void loadPage(long id,
GridCacheQueryAdapter<?> qry,
Collection<ClusterNode> nodes,
boolean all)
id - Query ID.qry - Query.nodes - Nodes.all - Whether to load all pages.public abstract CacheQueryFuture<?> queryFieldsLocal(GridCacheQueryBean qry)
qry - Query.public abstract CacheQueryFuture<?> queryFieldsDistributed(GridCacheQueryBean qry, Collection<ClusterNode> nodes)
qry - Query.nodes - Nodes.protected void runFieldsQuery(org.apache.ignite.internal.processors.cache.query.GridCacheQueryInfo qryInfo)
qryInfo - Query info.protected void runQuery(org.apache.ignite.internal.processors.cache.query.GridCacheQueryInfo qryInfo)
qryInfo - Query info.protected GridCloseableIterator scanQueryLocal(GridCacheQueryAdapter qry, boolean updateStatistics) throws IgniteCheckedException
qry - Query.updateStatistics - Update statistics flag.IgniteCheckedExceptionpublic void removeQueryResult(@Nullable
@Nullable UUID sndId,
long reqId)
sndId - Sender node ID.reqId - Request ID.protected void removeFieldsQueryResult(@Nullable
@Nullable UUID sndId,
long reqId)
sndId - Sender node ID.reqId - Request ID.protected abstract boolean onPageReady(boolean loc,
org.apache.ignite.internal.processors.cache.query.GridCacheQueryInfo qryInfo,
@Nullable
@Nullable Collection<?> data,
boolean finished,
@Nullable
@Nullable Throwable e)
loc - Local query or not.qryInfo - Query info.data - Result data.finished - Last page or not.e - Exception in case of error.true if page was processed right.protected abstract boolean onFieldsPageReady(boolean loc,
org.apache.ignite.internal.processors.cache.query.GridCacheQueryInfo qryInfo,
@Nullable
@Nullable List<GridQueryFieldMetadata> metaData,
@Nullable
@Nullable Collection<?> entities,
@Nullable
@Nullable Collection<?> data,
boolean finished,
@Nullable
@Nullable Throwable e)
loc - Local query or not.qryInfo - Query info.metaData - Meta data.entities - Indexing entities.data - Data.finished - Last page or not.e - Exception in case of error.true if page was processed right.public QueryMetrics metrics()
public Collection<GridCacheQueryDetailMetricsAdapter> detailMetrics()
CacheConfiguration.setQueryDetailMetricsSize(int)public void evictDetailMetrics()
public void resetMetrics()
public void resetDetailMetrics()
public void collectMetrics(GridCacheQueryType qryType, String qry, long startTime, long duration, boolean failed)
qryType - Query type.qry - Query description.startTime - Query start size.duration - Execution duration.failed - True if query execution failed.public Collection<GridCacheSqlMetadata> sqlMetadata() throws IgniteCheckedException
IgniteCheckedException - In case of error.public Collection<GridCacheSqlMetadata> sqlMetadataV2() throws IgniteCheckedException
IgniteCheckedException - In case of error.public AffinityTopologyVersion queryTopologyVersion()
public void printMemoryStats()
printMemoryStats in interface GridCacheManager<K,V>printMemoryStats in class GridCacheManagerAdapter<K,V>public String cacheName()
public <R> CacheQuery<R> createSpiQuery(boolean keepBinary)
IndexingSpi.keepBinary - Keep binary flag.public <R> CacheQuery<R> createScanQuery(@Nullable @Nullable IgniteBiPredicate<K,V> filter, @Nullable @Nullable Integer part, boolean keepBinary, Boolean dataPageScanEnabled)
filter - Scan filter.part - Partition.keepBinary - Keep binary flag.dataPageScanEnabled - Flag to enable data page scan.public <T,R> CacheQuery<R> createScanQuery(@Nullable @Nullable IgniteBiPredicate<K,V> filter, @Nullable @Nullable IgniteClosure<T,R> trans, @Nullable @Nullable Integer part, boolean keepBinary, boolean forceLocal, Boolean dataPageScanEnabled)
filter - Scan filter.trans - Transformer.part - Partition.keepBinary - Keep binary flag.forceLocal - Flag to force local scan.dataPageScanEnabled - Flag to enable data page scan.public CacheQuery<Map.Entry<K,V>> createFullTextQuery(String clsName, String search, int limit, boolean keepBinary)
CacheQuery
documentation.clsName - Query class name.search - Search clause.limit - Limits response records count. If 0 or less, considered to be no limit.keepBinary - Keep binary flag.public ConcurrentMap<UUID,GridCacheQueryManager.RequestFutureMap> queryIterators()
public GridConcurrentHashSet<GridCacheQueryManager.ScanQueryIterator> localQueryIterators()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.9.1 Release Date : December 9 2020