public class IgniteH2Indexing extends Object implements GridQueryIndexing
For each registered GridQueryTypeDescriptor this SPI will create respective SQL table with
'_key' and '_val' fields for key and value, and fields from
GridQueryTypeDescriptor.fields().
For each table it will create indexes declared in GridQueryTypeDescriptor.indexes().
| Modifier and Type | Field and Description |
|---|---|
protected GridKernalContext |
ctx |
static String |
INDEX_REBUILD_MNTC_TASK_NAME
Index rebuild maintenance task name.
|
protected PartitionReservationManager |
partReservationMgr
Partition reservation manager.
|
| Constructor and Description |
|---|
IgniteH2Indexing() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclusterTimezone, clusterTimezonepublic static final String INDEX_REBUILD_MNTC_TASK_NAME
protected volatile GridKernalContext ctx
protected PartitionReservationManager partReservationMgr
public GridKernalContext kernalContext()
public List<JdbcParameterMeta> parameterMetaData(String schemaName, SqlFieldsQuery qry) throws IgniteSQLException
parameterMetaData in interface GridQueryIndexingIgniteSQLExceptionpublic List<GridQueryFieldMetadata> resultMetaData(String schemaName, SqlFieldsQuery qry) throws IgniteSQLException
resultMetaData in interface GridQueryIndexingIgniteSQLExceptionpublic void store(GridCacheContext cctx, GridQueryTypeDescriptor type, CacheDataRow row, @Nullable @Nullable CacheDataRow prevRow, boolean prevRowAvailable) throws IgniteCheckedException
store in interface GridQueryIndexingIgniteCheckedExceptionpublic void remove(GridCacheContext cctx, GridQueryTypeDescriptor type, CacheDataRow row) throws IgniteCheckedException
remove in interface GridQueryIndexingIgniteCheckedExceptionpublic void dynamicIndexCreate(String schemaName, String tblName, QueryIndexDescriptorImpl idxDesc, boolean ifNotExists, SchemaIndexCacheVisitor cacheVisitor) throws IgniteCheckedException
dynamicIndexCreate in interface GridQueryIndexingIgniteCheckedExceptionpublic void dynamicIndexDrop(String schemaName, String idxName, boolean ifExists) throws IgniteCheckedException
dynamicIndexDrop in interface GridQueryIndexingIgniteCheckedExceptionpublic void dynamicAddColumn(String schemaName, String tblName, List<QueryField> cols, boolean ifTblExists, boolean ifColNotExists) throws IgniteCheckedException
dynamicAddColumn in interface GridQueryIndexingIgniteCheckedExceptionpublic void dynamicDropColumn(String schemaName, String tblName, List<String> cols, boolean ifTblExists, boolean ifColExists) throws IgniteCheckedException
dynamicDropColumn in interface GridQueryIndexingIgniteCheckedExceptionpublic <K,V> GridCloseableIterator<IgniteBiTuple<K,V>> queryLocalText(String schemaName, String cacheName, String qry, String typeName, IndexingQueryFilter filters) throws IgniteCheckedException
queryLocalText in interface GridQueryIndexingIgniteCheckedExceptionpublic <K,V> GridCloseableIterator<IgniteBiTuple<K,V>> queryLocalVector(String schemaName, String cacheName, String field, float[] qryVector, int k, float threshold, String typeName, IndexingQueryFilter filter) throws IgniteCheckedException
queryLocalVector in interface GridQueryIndexingIgniteCheckedExceptionpublic static int operationTimeout(int qryTimeout,
IgniteTxAdapter tx)
qryTimeout - Query timeout in milliseconds.tx - Transaction.public long streamUpdateQuery(String schemaName, String qry, @Nullable @Nullable Object[] params, IgniteDataStreamer<?,?> streamer, String qryInitiatorId) throws IgniteCheckedException
streamUpdateQuery in interface GridQueryIndexingIgniteCheckedExceptionpublic List<Long> streamBatchedUpdateQuery(String schemaName, String qry, List<Object[]> params, SqlClientContext cliCtx, String qryInitiatorId) throws IgniteCheckedException
streamBatchedUpdateQuery in interface GridQueryIndexingIgniteCheckedExceptionpublic ResultSet executeSqlQueryWithTimer(H2PooledConnection conn, String sql, @Nullable @Nullable Collection<Object> params, int timeoutMillis, @Nullable @Nullable GridQueryCancel cancel, Boolean dataPageScanEnabled, H2QueryInfo qryInfo, long maxMem) throws IgniteCheckedException
conn - Connection,sql - Sql query.params - Parameters.timeoutMillis - Query timeout.cancel - Query cancel.dataPageScanEnabled - If data page scan is enabled.IgniteCheckedException - If failed.public void enableDataPageScan(Boolean dataPageScanEnabled)
dataPageScanEnabled - If data page scan is enabled.public ResultSet executeSqlQueryWithTimer(PreparedStatement stmt, H2PooledConnection conn, String sql, int timeoutMillis, @Nullable @Nullable GridQueryCancel cancel, Boolean dataPageScanEnabled, H2QueryInfo qryInfo, long maxMem) throws IgniteCheckedException
stmt - Prepared statement for query.conn - Connection.sql - Sql query.timeoutMillis - Query timeout.cancel - Query cancel.dataPageScanEnabled - If data page scan is enabled.IgniteCheckedException - If failed.public org.apache.ignite.internal.processors.query.h2.H2MemoryTracker memTracker(H2QueryInfo qryInfo)
public void initSession(H2PooledConnection conn, H2QueryInfo qryInfo, long maxMem)
conn - Connection.qryInfo - Query info.maxMem - Max memory.public SqlFieldsQuery generateFieldsQuery(String cacheName, SqlQuery qry)
generateFieldsQuery in interface GridQueryIndexingpublic <K,V> SqlFieldsQuery generateFieldsQuery(String cacheName, IndexQuery<K,V> qry, String type)
generateFieldsQuery in interface GridQueryIndexingpublic List<FieldsQueryCursor<List<?>>> querySqlFields(String schemaName, SqlFieldsQuery qry, @Nullable @Nullable SqlClientContext cliCtx, boolean keepBinary, boolean failOnMultipleStmts, GridQueryCancel cancel)
querySqlFields in interface GridQueryIndexingpublic void registerQueryStartedListener(Consumer<GridQueryStartedInfo> lsnr)
lsnr - Listener.public boolean unregisterQueryStartedListener(Object lsnr)
lsnr - Listener.public void registerQueryFinishedListener(Consumer<GridQueryFinishedInfo> lsnr)
lsnr - Listener.public boolean unregisterQueryFinishedListener(Object lsnr)
lsnr - Listener.public UpdateSourceIterator<?> executeUpdateOnDataNodeTransactional(GridCacheContext<?,?> cctx, int[] ids, int[] parts, String schema, String qry, Object[] params, int flags, int pageSize, int timeout, AffinityTopologyVersion topVer, MvccSnapshot mvccSnapshot, GridQueryCancel cancel)
executeUpdateOnDataNodeTransactional in interface GridQueryIndexingpublic UpdateResult executeUpdateOnDataNode(String schemaName, SqlFieldsQuery qry, IndexingQueryFilter filter, GridQueryCancel cancel, boolean loc) throws IgniteCheckedException
schemaName - Schema name.qry - Query.filter - Filter.cancel - Cancel state.loc - Locality flag.IgniteCheckedException - if failed.public boolean registerType(GridCacheContextInfo cacheInfo, GridQueryTypeDescriptor type, boolean isSql) throws IgniteCheckedException
registerType in interface GridQueryIndexingcacheInfo - Cache context info.type - Type description.isSql - true in case table has been created from SQL.IgniteCheckedException - In case of error.public GridCacheContextInfo registeredCacheInfo(String cacheName)
registeredCacheInfo in interface GridQueryIndexingpublic void closeCacheOnClient(String cacheName)
closeCacheOnClient in interface GridQueryIndexingpublic String schema(String cacheName)
schema in interface GridQueryIndexingpublic Set<String> schemasNames()
schemasNames in interface GridQueryIndexingpublic Collection<TableInformation> tablesInformation(String schemaNamePtrn, String tblNamePtrn, String... tblTypes)
tablesInformation in interface GridQueryIndexingpublic Collection<ColumnInformation> columnsInformation(String schemaNamePtrn, String tblNamePtrn, String colNamePtrn)
columnsInformation in interface GridQueryIndexingpublic boolean isConvertibleToColumnType(String schemaName, String tblName, String colName, Class<?> cls)
isConvertibleToColumnType in interface GridQueryIndexingpublic boolean isStreamableInsertStatement(String schemaName, SqlFieldsQuery qry) throws SQLException
isStreamableInsertStatement in interface GridQueryIndexingSQLExceptionpublic GridQueryRowCacheCleaner rowCacheCleaner(int grpId)
rowCacheCleaner in interface GridQueryIndexingpublic void markAsRebuildNeeded(GridCacheContext cctx)
markAsRebuildNeeded in interface GridQueryIndexing@Nullable public @Nullable IgniteInternalFuture<?> rebuildInMemoryIndexes(GridCacheContext cctx)
rebuildInMemoryIndexes in interface GridQueryIndexing@Nullable public @Nullable IgniteInternalFuture<?> rebuildIndexesFromHash(GridCacheContext cctx, boolean force)
rebuildIndexesFromHash in interface GridQueryIndexingprotected void rebuildIndexesFromHash0(GridCacheContext cctx, SchemaIndexCacheVisitorClosure clo, GridFutureAdapter<Void> rebuildIdxFut, SchemaIndexOperationCancellationToken cancel)
cctx - Cache context.clo - Closure.rebuildIdxFut - Future for rebuild indexes.cancel - Cancellation token.public GridSpinBusyLock busyLock()
public GridMapQueryExecutor mapQueryExecutor()
public GridReduceQueryExecutor reduceQueryExecutor()
public RunningQueryManager runningQueryManager()
public QueryMemoryManager memoryManager()
public void start(GridKernalContext ctx, GridSpinBusyLock busyLock) throws IgniteCheckedException
start in interface GridQueryIndexingIgniteCheckedExceptionpublic void onKernalStart()
onKernalStart in interface GridQueryIndexingpublic void onMessage(UUID nodeId, Object msg)
nodeId - Node ID.msg - Message.public CacheObjectValueContext objectContext()
public boolean send(Object topic, int topicOrd, Collection<ClusterNode> nodes, Message msg, @Nullable @Nullable IgniteBiClosure<ClusterNode,Message,Message> specialize, @Nullable @Nullable IgniteInClosure2X<ClusterNode,Message> locNodeHnd, byte plc, boolean runLocParallel)
topic - Topic.topicOrd - Topic ordinal for GridTopic.nodes - Nodes.msg - Message.specialize - Optional closure to specialize message for each node.locNodeHnd - Handler for local node.plc - Policy identifying the executor service which will process message.runLocParallel - Run local handler in parallel thread.true If all messages sent successfully.public org.gridgain.internal.h2.store.DataHandler dataHandler()
public void stop()
stop in interface GridQueryIndexingpublic void onClientDisconnect()
throws IgniteCheckedException
onClientDisconnect in interface GridQueryIndexingIgniteCheckedExceptionpublic boolean initCacheContext(GridCacheContext cacheCtx)
initCacheContext in interface GridQueryIndexingpublic void registerCache(String cacheName, String schemaName, GridCacheContextInfo<?,?> cacheInfo) throws IgniteCheckedException
registerCache in interface GridQueryIndexingIgniteCheckedExceptionpublic void unregisterCache(GridCacheContextInfo cacheInfo, boolean destroy, boolean clearIdx)
unregisterCache in interface GridQueryIndexingpublic void destroyOrphanIndex(RootPage page, String indexName, int grpId, PageMemory pageMemory, GridAtomicLong removeId, ReuseList reuseList, boolean mvccEnabled) throws IgniteCheckedException
destroyOrphanIndex in interface GridQueryIndexingIgniteCheckedExceptionpublic IndexingQueryFilter backupFilter(@Nullable @Nullable AffinityTopologyVersion topVer, @Nullable @Nullable int[] parts)
backupFilter in interface GridQueryIndexingpublic IndexingQueryFilter backupFilter(@Nullable @Nullable AffinityTopologyVersion topVer, @Nullable @Nullable int[] parts, boolean treatReplicatedAsPartitioned)
topVer - Topology version.parts - Partitions.treatReplicatedAsPartitioned - true if need to treat replicated as partitioned (for outer joins).public AffinityTopologyVersion readyTopologyVersion()
public boolean serverTopologyChanged(AffinityTopologyVersion readyVer)
readyVer - Ready topology version.true If pending distributed exchange exists because server topology is changed.public void awaitForReadyTopologyVersion(AffinityTopologyVersion topVer) throws IgniteCheckedException
topVer - Topology version.IgniteCheckedException - If failed.public void onDisconnected(IgniteFuture<?> reconnectFut)
onDisconnected in interface GridQueryIndexingpublic List<GridRunningQueryInfo> runningSqlQueries()
public Collection<GridRunningQueryInfo> runningQueries(long duration)
runningQueries in interface GridQueryIndexingpublic void cancelQueries(Collection<Long> queries)
cancelQueries in interface GridQueryIndexingpublic void onKernalStop()
onKernalStop in interface GridQueryIndexingpublic QueryContextRegistry queryContextRegistry()
public ConnectionManager connections()
public QueryParser parser()
public SchemaManager schemaManager()
public PartitionExtractor partitionExtractor()
public PartitionReservationManager partitionReservationManager()
public org.apache.ignite.internal.processors.query.h2.H2MemoryTracker memoryTrackerForQry(Long qryId)
null
if id is null or there is no registered query with such id.public void registerMxBeans(IgniteMBeansManager mbMgr) throws IgniteCheckedException
registerMxBeans in interface GridQueryIndexingIgniteCheckedExceptionpublic LongRunningQueryManager longRunningQueries()
public long indexSize(String schemaName, String tblName, String idxName) throws IgniteCheckedException
indexSize in interface GridQueryIndexingIgniteCheckedExceptionpublic DistributedSqlConfiguration distributedConfiguration()
public Map<String,Integer> secondaryIndexesInlineSize()
secondaryIndexesInlineSize in interface GridQueryIndexingpublic IgniteStatisticsManager statsManager()
public void defragment(CacheGroupContext grpCtx, CacheGroupContext newCtx, PageMemoryEx partPageMem, IntMap<LinkMap> mappingByPart, CheckpointTimeoutLock cpLock, Runnable cancellationChecker, IgniteThreadPoolExecutor defragmentationThreadPool) throws IgniteCheckedException
defragment in interface GridQueryIndexingIgniteCheckedExceptionpublic void markIndexRenamed(GridCacheContext<?,?> cacheCtx, String indexTreeName)
markIndexRenamed in interface GridQueryIndexingpublic <T> T executeWithResumableTimeTracking(IgniteThrowableSupplier<T> task, H2QueryInfo qryInfo) throws IgniteCheckedException
task - Query/fetch to execute.qryInfo - Query info.IgniteCheckedException - If failed.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 8.9.23-p1 Release Date : November 19 2025