public class GridQueryProcessor extends GridProcessorAdapter
GridComponent.DiscoveryDataExchangeType| Modifier and Type | Field and Description |
|---|---|
static String |
_VAL |
static Class<? extends GridQueryIndexing> |
idxCls
For tests.
|
ctx, log| Constructor and Description |
|---|
GridQueryProcessor(GridKernalContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelQueries(Collection<Long> queries)
Cancel specified queries.
|
IgniteDataStreamer<?,?> |
createStreamer(String spaceName,
PreparedStatement nativeStmt,
long autoFlushFreq,
int nodeBufSize,
int nodeParOps,
boolean allowOverwrite) |
<R> R |
executeQuery(GridCacheQueryType qryType,
String qry,
GridCacheContext<?,?> cctx,
IgniteOutClosureX<R> clo,
boolean complete) |
static AffinityTopologyVersion |
getRequestAffinityTopologyVersion() |
static boolean |
isEnabled(CacheConfiguration<?,?> ccfg) |
static boolean |
isGeometryClass(Class<?> cls)
Checks if the given class is GEOMETRY.
|
static boolean |
isSqlType(Class<?> cls)
Checks if the given class can be mapped to a simple SQL type.
|
boolean |
moduleEnabled() |
void |
onCacheStart(GridCacheContext cctx) |
void |
onCacheStop(GridCacheContext cctx) |
void |
onDisconnected(IgniteFuture<?> reconnectFut)
Client disconnected callback.
|
void |
onKernalStop(boolean cancel)
Callback to notify that kernal is about to stop.
|
void |
onSwap(String spaceName,
CacheObject key)
Will be called when entry for key will be swapped.
|
void |
onUndeploy(String space,
ClassLoader ldr)
Removes index tables for all classes belonging to given class loader.
|
void |
onUnswap(String spaceName,
CacheObject key,
CacheObject val)
Will be called when entry for key will be unswapped.
|
PreparedStatement |
prepareNativeStatement(String schema,
String sql) |
<K,V> QueryCursor<javax.cache.Cache.Entry<K,V>> |
queryLocal(GridCacheContext<?,?> cctx,
SqlQuery qry,
boolean keepBinary) |
QueryCursor<List<?>> |
queryLocalFields(GridCacheContext<?,?> cctx,
SqlFieldsQuery qry) |
<K,V> GridCloseableIterator<IgniteBiTuple<K,V>> |
queryText(String space,
String clause,
String resType,
IndexingQueryFilter filters) |
QueryCursor<List<?>> |
queryTwoStep(GridCacheContext<?,?> cctx,
SqlFieldsQuery qry) |
<K,V> QueryCursor<javax.cache.Cache.Entry<K,V>> |
queryTwoStep(GridCacheContext<?,?> cctx,
SqlQuery qry) |
IgniteInternalFuture<?> |
rebuildAllIndexes()
Rebuilds all search indexes for given spi.
|
IgniteInternalFuture<?> |
rebuildIndexes(String space,
String valTypeName)
Rebuilds all search indexes of given value type for given space of spi.
|
void |
remove(String space,
CacheObject key,
CacheObject val) |
Collection<GridRunningQueryInfo> |
runningQueries(long duration)
Collect queries that already running more than specified duration.
|
static void |
setRequestAffinityTopologyVersion(AffinityTopologyVersion ver) |
String |
space(String schema) |
void |
start()
Starts grid component.
|
void |
stop(boolean cancel)
Stops grid component.
|
void |
store(String space,
CacheObject key,
CacheObject val,
byte[] ver,
long expirationTime)
Writes key-value pair to index.
|
long |
streamUpdateQuery(String spaceName,
IgniteDataStreamer<?,?> streamer,
String qry,
Object[] args) |
GridQueryTypeDescriptor |
type(String space,
String typeName)
Gets type descriptor for space and type name.
|
static String |
typeName(Class<?> cls)
Gets type name by class.
|
static String |
typeName(String clsName)
Gets type name by class.
|
Collection<GridQueryTypeDescriptor> |
types(String space)
Gets types for space.
|
static int |
validateTimeout(int timeout,
TimeUnit timeUnit) |
assertParameter, collectDiscoveryData, discoveryDataType, onDiscoveryDataReceived, onKernalStart, onReconnected, printMemoryStats, toString, validateNodepublic static final String _VAL
public static Class<? extends GridQueryIndexing> idxCls
public GridQueryProcessor(GridKernalContext ctx) throws IgniteCheckedException
ctx - Kernal context.IgniteCheckedExceptionpublic void start()
throws IgniteCheckedException
start in interface GridComponentstart in class GridProcessorAdapterIgniteCheckedException - Throws in case of any errors.public static boolean isEnabled(CacheConfiguration<?,?> ccfg)
ccfg - Cache configuration.true If query index must be enabled for this cache.public boolean moduleEnabled()
true If indexing module is in classpath and successfully initialized.public void onKernalStop(boolean cancel)
onKernalStop in interface GridComponentonKernalStop in class GridProcessorAdaptercancel - Flag indicating whether jobs should be canceled.public void stop(boolean cancel)
throws IgniteCheckedException
stop in interface GridComponentstop in class GridProcessorAdaptercancel - If true, then all ongoing tasks or jobs for relevant
components need to be cancelled.IgniteCheckedException - Thrown in case of any errors.public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException
onDisconnected in interface GridComponentonDisconnected in class GridProcessorAdapterreconnectFut - Reconnect future.IgniteCheckedException - If failed.public void onCacheStart(GridCacheContext cctx) throws IgniteCheckedException
cctx - Cache context.IgniteCheckedException - If failed.public void onCacheStop(GridCacheContext cctx)
cctx - Cache context.public IgniteInternalFuture<?> rebuildIndexes(@Nullable String space, String valTypeName)
space - Space.valTypeName - Value type name.public IgniteInternalFuture<?> rebuildAllIndexes()
public void store(String space, CacheObject key, CacheObject val, byte[] ver, long expirationTime) throws IgniteCheckedException
space - Space.key - Key.val - Value.ver - Cache entry version.expirationTime - Expiration time or 0 if never expires.IgniteCheckedException - In case of error.public QueryCursor<List<?>> queryTwoStep(GridCacheContext<?,?> cctx, SqlFieldsQuery qry)
cctx - Cache context.qry - Query.public long streamUpdateQuery(@Nullable
String spaceName,
IgniteDataStreamer<?,?> streamer,
String qry,
Object[] args)
spaceName - Cache name.streamer - Data streamer.qry - Query.public <K,V> QueryCursor<javax.cache.Cache.Entry<K,V>> queryTwoStep(GridCacheContext<?,?> cctx, SqlQuery qry)
cctx - Cache context.qry - Query.public <K,V> QueryCursor<javax.cache.Cache.Entry<K,V>> queryLocal(GridCacheContext<?,?> cctx, SqlQuery qry, boolean keepBinary)
cctx - Cache context.qry - Query.keepBinary - Keep binary flag.public Collection<GridRunningQueryInfo> runningQueries(long duration)
duration - Duration to check.public void cancelQueries(Collection<Long> queries)
queries - Queries ID's to cancel.public PreparedStatement prepareNativeStatement(String schema, String sql) throws SQLException
schema - Schema.sql - Query.PreparedStatement from underlying engine to supply metadata to Prepared - most likely H2.SQLExceptionpublic String space(String schema) throws SQLException
schema - Schema name.SQLExceptionpublic IgniteDataStreamer<?,?> createStreamer(String spaceName, PreparedStatement nativeStmt, long autoFlushFreq, int nodeBufSize, int nodeParOps, boolean allowOverwrite)
spaceName - Space name.nativeStmt - Native statement.autoFlushFreq - Automatic data flushing frequency, disabled if 0.nodeBufSize - Per node buffer size - see IgniteDataStreamer.perNodeBufferSize(int)nodeParOps - Per node parallel ops count - see IgniteDataStreamer.perNodeParallelOperations(int)allowOverwrite - Overwrite existing cache values on key duplication.IgniteDataStreamer tailored to specific needs of given native statement based on its metadata.IgniteDataStreamer.allowOverwrite()public static int validateTimeout(int timeout,
TimeUnit timeUnit)
timeout - Timeout.timeUnit - Time unit.public QueryCursor<List<?>> queryLocalFields(GridCacheContext<?,?> cctx, SqlFieldsQuery qry)
cctx - Cache context.qry - Query.public void remove(String space, CacheObject key, CacheObject val) throws IgniteCheckedException
space - Space.key - Key.IgniteCheckedException - Thrown in case of any errors.public static boolean isSqlType(Class<?> cls)
cls - Class.true If can.public static boolean isGeometryClass(Class<?> cls)
cls - Class.true If this is geometry.public static String typeName(Class<?> cls)
cls - Class.public static String typeName(String clsName)
clsName - Class name.public <K,V> GridCloseableIterator<IgniteBiTuple<K,V>> queryText(String space, String clause, String resType, IndexingQueryFilter filters) throws IgniteCheckedException
K - Key type.V - Value type.space - Space.clause - Clause.resType - Result type.filters - Key and value filters.IgniteCheckedException - If failed.public void onSwap(String spaceName, CacheObject key) throws IgniteCheckedException
spaceName - Space name.key - key.IgniteCheckedException - If failed.public void onUnswap(String spaceName, CacheObject key, CacheObject val) throws IgniteCheckedException
spaceName - Space name.key - Key.val - Value.IgniteCheckedException - If failed.public void onUndeploy(@Nullable
String space,
ClassLoader ldr)
throws IgniteCheckedException
space - Space name.ldr - Class loader to undeploy.IgniteCheckedException - If undeploy failed.public Collection<GridQueryTypeDescriptor> types(@Nullable String space)
space - Space name.public GridQueryTypeDescriptor type(@Nullable String space, String typeName) throws IgniteCheckedException
space - Space name.typeName - Type name.IgniteCheckedException - If failed.public <R> R executeQuery(GridCacheQueryType qryType, String qry, GridCacheContext<?,?> cctx, IgniteOutClosureX<R> clo, boolean complete) throws IgniteCheckedException
qryType - Query type.qry - Query description.cctx - Cache context.clo - Closure.complete - Complete.IgniteCheckedExceptionpublic static void setRequestAffinityTopologyVersion(AffinityTopologyVersion ver)
ver - Version.public static AffinityTopologyVersion getRequestAffinityTopologyVersion()
Follow @ApacheIgnite
Ignite Fabric : ver. 1.9.0 Release Date : March 2 2017