public abstract class GridCacheQueryManager<K,V> extends GridCacheManagerAdapter<K,V>
cctx, log, starting
Constructor and Description |
---|
GridCacheQueryManager() |
Modifier and Type | Method and Description |
---|---|
<K,V> IndexingQueryFilter |
backupsFilter(boolean includeBackups) |
void |
collectMetrics(GridCacheQueryType qryType,
String qry,
long startTime,
long duration,
boolean failed) |
CacheQuery<Map.Entry<K,V>> |
createFullTextQuery(String clsName,
String search,
boolean keepBinary)
Creates user's full text query, queried class, and query clause.
|
<T,R> CacheQuery<R> |
createScanQuery(IgniteBiPredicate<K,V> filter,
IgniteClosure<T,R> trans,
Integer part,
boolean keepBinary)
Creates user's predicate based scan query.
|
<R> CacheQuery<R> |
createScanQuery(IgniteBiPredicate<K,V> filter,
Integer part,
boolean keepBinary)
Creates user's predicate based scan query.
|
<R> CacheQuery<R> |
createSpiQuery(boolean keepBinary)
Query for
IndexingSpi . |
CacheQuery<List<?>> |
createSqlFieldsQuery(String qry,
boolean keepBinary)
Creates user's SQL fields query for given clause.
|
Collection<GridCacheQueryDetailMetricsAdapter> |
detailMetrics()
Gets cache queries detailed metrics.
|
boolean |
enabled() |
void |
evictDetailMetrics()
Evict detail metrics.
|
abstract void |
loadPage(long id,
GridCacheQueryAdapter<?> qry,
Collection<ClusterNode> nodes,
boolean all)
Loads page.
|
QueryMetrics |
metrics()
Gets cache queries metrics.
|
protected abstract boolean |
onFieldsPageReady(boolean loc,
org.apache.ignite.internal.processors.cache.query.GridCacheQueryInfo qryInfo,
List<GridQueryFieldMetadata> metaData,
Collection<?> entities,
Collection<?> data,
boolean finished,
Throwable e) |
protected void |
onKernalStop0(boolean cancel) |
protected abstract boolean |
onPageReady(boolean loc,
org.apache.ignite.internal.processors.cache.query.GridCacheQueryInfo qryInfo,
Collection<?> data,
boolean finished,
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.
|
CacheQueryFuture<?> |
queryLocal(GridCacheQueryBean qry)
Executes local query.
|
AffinityTopologyVersion |
queryTopologyVersion() |
void |
remove(KeyCacheObject key,
int partId,
CacheObject val,
GridCacheVersion ver) |
protected void |
removeFieldsQueryResult(UUID sndId,
long reqId) |
protected void |
removeQueryResult(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 updStatisticsIfNeeded)
Process local scan query.
|
String |
space()
FOR TESTING ONLY
|
Collection<GridCacheSqlMetadata> |
sqlMetadata()
Gets SQL metadata.
|
void |
start0() |
void |
stop0(boolean cancel,
boolean destroy)
Stops query manager.
|
void |
store(KeyCacheObject key,
int partId,
CacheObject prevVal,
GridCacheVersion prevVer,
CacheObject val,
GridCacheVersion ver,
long expirationTime,
long link)
Writes key-value pair to index.
|
context, kernalStartInfo, kernalStopInfo, log, onDisconnected, onKernalStart, onKernalStart0, onKernalStop, start, startInfo, stop, stopInfo, toString
public void start0() throws IgniteCheckedException
start0
in class GridCacheManagerAdapter<K,V>
IgniteCheckedException
- If failed.public boolean enabled()
True
if indexing is enabled for cache.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(KeyCacheObject key, int partId, @Nullable CacheObject prevVal, @Nullable GridCacheVersion prevVer, CacheObject val, GridCacheVersion ver, long expirationTime, long link) throws IgniteCheckedException
key
- Key.partId
- Partition.prevVal
- Previous value.prevVer
- Previous version.val
- Value.ver
- Cache entry version.expirationTime
- Expiration time or 0 if never expires.link
- Link.IgniteCheckedException
- In case of error.public void remove(KeyCacheObject key, int partId, CacheObject val, GridCacheVersion ver) throws IgniteCheckedException
key
- Key.partId
- Partition.val
- Value.ver
- Version.IgniteCheckedException
- Thrown in case of any errors.public CacheQueryFuture<?> queryLocal(GridCacheQueryBean qry)
qry
- Query.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 updStatisticsIfNeeded) throws IgniteCheckedException
qry
- Query.updStatisticsIfNeeded
- Update statistics flag.IgniteCheckedException
protected void removeQueryResult(@Nullable UUID sndId, long reqId)
sndId
- Sender node ID.reqId
- Request ID.protected void removeFieldsQueryResult(@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 Collection<?> data, boolean finished, @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 List<GridQueryFieldMetadata> metaData, @Nullable Collection<?> entities, @Nullable Collection<?> data, boolean finished, @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.@Nullable public <K,V> IndexingQueryFilter backupsFilter(boolean includeBackups)
K
- Key type.V
- Value type.includeBackups
- Include backups.public AffinityTopologyVersion queryTopologyVersion()
public void printMemoryStats()
printMemoryStats
in interface GridCacheManager<K,V>
printMemoryStats
in class GridCacheManagerAdapter<K,V>
public String space()
public <R> CacheQuery<R> createSpiQuery(boolean keepBinary)
IndexingSpi
.keepBinary
- Keep binary flag.public <R> CacheQuery<R> createScanQuery(@Nullable IgniteBiPredicate<K,V> filter, @Nullable Integer part, boolean keepBinary)
filter
- Scan filter.part
- Partition.keepBinary
- Keep binary flag.public <T,R> CacheQuery<R> createScanQuery(@Nullable IgniteBiPredicate<K,V> filter, @Nullable IgniteClosure<T,R> trans, @Nullable Integer part, boolean keepBinary)
filter
- Scan filter.part
- Partition.keepBinary
- Keep binary flag.public CacheQuery<Map.Entry<K,V>> createFullTextQuery(String clsName, String search, boolean keepBinary)
CacheQuery
documentation.clsName
- Query class name.search
- Search clause.keepBinary
- Keep binary flag.public CacheQuery<List<?>> createSqlFieldsQuery(String qry, boolean keepBinary)
CacheQuery
documentation.qry
- Query.keepBinary
- Keep binary flag.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017