public abstract class GridCacheQueryManager<K,V> extends GridCacheManagerAdapter<K,V>
cctx, log| Constructor and Description |
|---|
GridCacheQueryManager() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
loadPage(long id,
GridCacheQueryAdapter<?> qry,
Collection<GridNode> nodes,
boolean all)
Loads page.
|
GridCacheQueryMetrics |
metrics()
Gets cache queries metrics.
|
protected abstract boolean |
onFieldsPageReady(boolean loc,
org.gridgain.grid.kernal.processors.cache.query.GridCacheQueryInfo qryInfo,
List<GridIndexingFieldMetadata> metaData,
Collection<List<GridIndexingEntity<?>>> 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.gridgain.grid.kernal.processors.cache.query.GridCacheQueryInfo qryInfo,
Collection<?> data,
boolean finished,
Throwable e)
Called when data for page is ready.
|
void |
onSwap(String swapSpaceName,
K key)
Entry for given key unswapped.
|
void |
onUndeploy(ClassLoader ldr)
Undeploys given class loader.
|
void |
onUnswap(K key,
V val,
byte[] valBytes)
Entry for given key unswapped.
|
void |
printMemoryStats()
Prints memory statistics for debugging purposes.
|
abstract GridCacheQueryFuture<?> |
queryDistributed(GridCacheQueryBean qry,
Collection<GridNode> nodes)
Executes distributed query.
|
abstract GridCacheQueryFuture<?> |
queryFieldsDistributed(GridCacheQueryBean qry,
Collection<GridNode> nodes)
Executes distributed fields query.
|
abstract GridCacheQueryFuture<?> |
queryFieldsLocal(GridCacheQueryBean qry)
Executes distributed fields query.
|
abstract GridCacheQueryFuture<?> |
queryLocal(GridCacheQueryBean qry)
Executes local query.
|
GridFuture<?> |
rebuildAllIndexes()
Rebuilds all search indexes of all types.
|
GridFuture<?> |
rebuildIndexes(Class<?> valType)
Rebuilds all search indexes of given value type.
|
boolean |
remove(K key,
byte[] keyBytes) |
protected void |
removeFieldsQueryResult(UUID sndId,
long reqId) |
protected void |
removeQueryIterator(UUID sndId,
long reqId) |
void |
resetMetrics()
Resets metrics.
|
protected void |
runFieldsQuery(org.gridgain.grid.kernal.processors.cache.query.GridCacheQueryInfo qryInfo)
Processes fields query request.
|
protected <R> void |
runQuery(org.gridgain.grid.kernal.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(K key,
byte[] keyBytes,
V val,
byte[] valBytes,
GridCacheVersion ver,
long expirationTime)
Writes key-value pair to index.
|
context, kernalStartInfo, kernalStopInfo, log, onKernalStart, onKernalStart0, onKernalStop, start, startInfo, stop, stopInfo, toStringpublic void start0()
throws GridException
start0 in class GridCacheManagerAdapter<K,V>GridException - If failed.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 GridException
valType - Value type.GridException - If failed.public GridFuture<?> rebuildIndexes(Class<?> valType)
valType - Value type.public GridFuture<?> rebuildAllIndexes()
public void onSwap(String swapSpaceName, K key) throws GridSpiException
swapSpaceName - Swap space name.key - Key.GridSpiException - If failed.public void onUnswap(K key, V val, byte[] valBytes) throws GridSpiException
key - Key.val - ValuevalBytes - Value bytes.GridSpiException - If failed.public void store(K key, @Nullable byte[] keyBytes, @Nullable V val, @Nullable byte[] valBytes, GridCacheVersion ver, long expirationTime) throws GridException
key - Key.keyBytes - Byte array with key data.val - Value.valBytes - Value bytes.ver - Cache entry version.expirationTime - Expiration time or 0 if never expires.GridException - In case of error.public boolean remove(K key, @Nullable byte[] keyBytes) throws GridException
key - Key.keyBytes - Byte array with key value.true if key was found and removed, otherwise false.GridException - Thrown in case of any errors.public void onUndeploy(ClassLoader ldr)
ldr - Class loader to undeploy.public abstract GridCacheQueryFuture<?> queryLocal(GridCacheQueryBean qry)
qry - Query.public abstract GridCacheQueryFuture<?> queryDistributed(GridCacheQueryBean qry, Collection<GridNode> nodes)
qry - Query.nodes - Nodes.public abstract void loadPage(long id,
GridCacheQueryAdapter<?> qry,
Collection<GridNode> nodes,
boolean all)
id - Query ID.qry - Query.nodes - Nodes.all - Whether to load all pages.public abstract GridCacheQueryFuture<?> queryFieldsLocal(GridCacheQueryBean qry)
qry - Query.public abstract GridCacheQueryFuture<?> queryFieldsDistributed(GridCacheQueryBean qry, Collection<GridNode> nodes)
qry - Query.nodes - Nodes.protected void runFieldsQuery(org.gridgain.grid.kernal.processors.cache.query.GridCacheQueryInfo qryInfo)
qryInfo - Query info.protected <R> void runQuery(org.gridgain.grid.kernal.processors.cache.query.GridCacheQueryInfo qryInfo)
qryInfo - Query info.protected void removeQueryIterator(@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.gridgain.grid.kernal.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.gridgain.grid.kernal.processors.cache.query.GridCacheQueryInfo qryInfo,
@Nullable
List<GridIndexingFieldMetadata> metaData,
@Nullable
Collection<List<GridIndexingEntity<?>>> 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 GridCacheQueryMetrics metrics()
public void resetMetrics()
public void onMetricsUpdate(long duration,
boolean fail)
duration - Execution duration.fail - true if execution failed.public Collection<GridCacheSqlMetadata> sqlMetadata() throws GridException
GridException - In case of error.public void printMemoryStats()
printMemoryStats in interface GridCacheManager<K,V>printMemoryStats in class GridCacheManagerAdapter<K,V>public String space()
Copyright © 2014. All rights reserved.