public abstract class GridCacheQueryManager<K,V> extends GridCacheManagerAdapter<K,V>
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_ITERATORS |
protected GridQueryProcessor |
qryProc |
cctx, log| Constructor and Description |
|---|
GridCacheQueryManager() |
| Modifier and Type | Method and Description |
|---|---|
<K,V> IndexingQueryFilter |
backupsFilter(boolean includeBackups) |
CacheQuery<Map.Entry<K,V>> |
createFullTextQuery(String clsName,
String search,
boolean keepPortable)
Creates user's full text query, queried class, and query clause.
|
CacheQuery<Map.Entry<K,V>> |
createScanQuery(IgniteBiPredicate<K,V> filter,
boolean keepPortable)
Creates user's predicate based scan query.
|
<R> CacheQuery<R> |
createSpiQuery(boolean keepPortable)
Query for
IndexingSpi. |
CacheQuery<List<?>> |
createSqlFieldsQuery(String qry,
boolean keepPortable)
Creates user's SQL fields query for given clause.
|
CacheQuery<List<?>> |
createSqlFieldsQuery(String qry,
boolean incMeta,
boolean keepPortable)
Creates SQL fields query which will include results metadata if needed.
|
boolean |
enabled() |
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) |
void |
onMetricsUpdate(long duration,
boolean fail) |
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 |
onSwap(CacheObject key)
Entry for given key unswapped.
|
void |
onUndeploy(ClassLoader ldr)
Undeploys given class loader.
|
void |
onUnswap(CacheObject key,
CacheObject val)
Entry for given key unswapped.
|
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.
|
abstract CacheQueryFuture<?> |
queryLocal(GridCacheQueryBean qry)
Executes local query.
|
IgniteInternalFuture<?> |
rebuildAllIndexes()
Rebuilds all search indexes of all types.
|
IgniteInternalFuture<?> |
rebuildIndexes(Class<?> valType)
Rebuilds all search indexes of given value type.
|
IgniteInternalFuture<?> |
rebuildIndexes(String typeName)
Rebuilds all search indexes of given value type.
|
void |
remove(CacheObject key,
CacheObject val) |
protected void |
removeFieldsQueryResult(UUID sndId,
long reqId) |
protected void |
removeQueryResult(UUID sndId,
long reqId) |
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.
|
long |
size(Class<?> valType)
Gets number of objects of given type in index.
|
String |
space()
FOR TESTING ONLY
|
Collection<GridCacheSqlMetadata> |
sqlMetadata()
Gets SQL metadata.
|
void |
start0() |
void |
stop0(boolean cancel)
Stops query manager.
|
void |
store(CacheObject key,
CacheObject val,
GridCacheVersion ver,
long expirationTime)
Writes key-value pair to index.
|
context, kernalStartInfo, kernalStopInfo, log, onKernalStart, onKernalStart0, onKernalStop, start, startInfo, stop, stopInfo, toStringpublic static int MAX_ITERATORS
protected GridQueryProcessor qryProc
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)
stop0 in class GridCacheManagerAdapter<K,V>cancel - Cancel queries.public long size(Class<?> valType) throws IgniteCheckedException
valType - Value type.IgniteCheckedException - If failed.public IgniteInternalFuture<?> rebuildIndexes(Class<?> valType)
valType - Value type.public IgniteInternalFuture<?> rebuildIndexes(String typeName)
typeName - Value type name.public IgniteInternalFuture<?> rebuildAllIndexes()
public void onSwap(CacheObject key) throws IgniteCheckedException
key - Key.IgniteCheckedException - If failed.public void onUnswap(CacheObject key, CacheObject val) throws IgniteCheckedException
key - Key.val - ValueIgniteCheckedException - If failed.public void store(CacheObject key, CacheObject val, GridCacheVersion ver, long expirationTime) throws IgniteCheckedException
key - Key.val - Value.ver - Cache entry version.expirationTime - Expiration time or 0 if never expires.IgniteCheckedException - In case of error.public void remove(CacheObject key, CacheObject val) throws IgniteCheckedException
key - Key.val - Value.IgniteCheckedException - Thrown in case of any errors.public void onUndeploy(ClassLoader ldr)
ldr - Class loader to undeploy.public abstract CacheQueryFuture<?> queryLocal(GridCacheQueryBean qry)
qry - Query.public abstract CacheQueryFuture<?> queryDistributed(GridCacheQueryBean qry, Collection<ClusterNode> nodes)
qry - Query.nodes - Nodes.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 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 void resetMetrics()
public void onMetricsUpdate(long duration,
boolean fail)
duration - Execution duration.fail - true if 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 void printMemoryStats()
printMemoryStats in interface GridCacheManager<K,V>printMemoryStats in class GridCacheManagerAdapter<K,V>public String space()
public <R> CacheQuery<R> createSpiQuery(boolean keepPortable)
IndexingSpi.keepPortable - Keep portable flag.public CacheQuery<Map.Entry<K,V>> createScanQuery(@Nullable IgniteBiPredicate<K,V> filter, boolean keepPortable)
filter - Scan filter.keepPortable - Keep portable flag.public CacheQuery<Map.Entry<K,V>> createFullTextQuery(String clsName, String search, boolean keepPortable)
CacheQuery documentation.clsName - Query class name.search - Search clause.keepPortable - Keep portable flag.public CacheQuery<List<?>> createSqlFieldsQuery(String qry, boolean keepPortable)
CacheQuery documentation.qry - Query.keepPortable - Keep portable flag.public CacheQuery<List<?>> createSqlFieldsQuery(String qry, boolean incMeta, boolean keepPortable)
qry - SQL query.incMeta - Whether to include results metadata.keepPortable - Keep portable flag.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.1.0-incubating Release Date : May 20 2015