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 Pattern |
INTERNAL_CMD_RE
A pattern for commands having internal implementation in Ignite.
|
static List<GridQueryFieldMetadata> |
UPDATE_RESULT_META
Dummy metadata for update result.
|
protected CacheQueryObjectValueContext |
valCtx
Cache object value context.
|
| Constructor and Description |
|---|
IgniteH2Indexing() |
public static final Pattern INTERNAL_CMD_RE
public static final List<GridQueryFieldMetadata> UPDATE_RESULT_META
protected volatile GridKernalContext ctx
protected CacheQueryObjectValueContext valCtx
public GridKernalContext kernalContext()
public Connection connectionForSchema(String schema)
schema - Schema.public PreparedStatement prepareNativeStatement(String schemaName, String sql)
prepareNativeStatement in interface GridQueryIndexingpublic void executeStatement(String schema, String sql) throws IgniteCheckedException
schema - Schemasql - SQL statement.IgniteCheckedException - If failed.public void store(GridCacheContext cctx, GridQueryTypeDescriptor type, CacheDataRow row, @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 long streamUpdateQuery(String schemaName, String qry, @Nullable Object[] params, IgniteDataStreamer<?,?> streamer) throws IgniteCheckedException
streamUpdateQuery in interface GridQueryIndexingIgniteCheckedExceptionpublic List<Long> streamBatchedUpdateQuery(String schemaName, String qry, List<Object[]> params, SqlClientContext cliCtx) throws IgniteCheckedException
streamBatchedUpdateQuery in interface GridQueryIndexingIgniteCheckedExceptionpublic ResultSet executeSqlQueryWithTimer(Connection conn, String sql, @Nullable Collection<Object> params, boolean useStmtCache, int timeoutMillis, @Nullable GridQueryCancel cancel) throws IgniteCheckedException
conn - Connection,sql - Sql query.params - Parameters.useStmtCache - If true uses stmt cache.timeoutMillis - Query timeout.cancel - Query cancel.IgniteCheckedException - If failed.public void bindParameters(PreparedStatement stmt, @Nullable Collection<Object> params) throws IgniteCheckedException
stmt - Prepared statement.params - Parameters collection.IgniteCheckedException - If failed.public FieldsQueryCursor<List<?>> queryLocalSqlFields(String schemaName, SqlFieldsQuery qry, boolean keepBinary, IndexingQueryFilter filter, GridQueryCancel cancel) throws IgniteCheckedException
queryLocalSqlFields in interface GridQueryIndexingIgniteCheckedExceptionpublic <K,V> QueryCursor<javax.cache.Cache.Entry<K,V>> queryLocalSql(String schemaName, String cacheName, SqlQuery qry, IndexingQueryFilter filter, boolean keepBinary) throws IgniteCheckedException
queryLocalSql in interface GridQueryIndexingIgniteCheckedExceptionpublic <K,V> QueryCursor<javax.cache.Cache.Entry<K,V>> queryDistributedSql(String schemaName, String cacheName, SqlQuery qry, boolean keepBinary)
queryDistributedSql in interface GridQueryIndexingpublic List<FieldsQueryCursor<List<?>>> querySqlFields(String schemaName, SqlFieldsQuery qry, @Nullable SqlClientContext cliCtx, boolean keepBinary, boolean failOnMultipleStmts, GridQueryCancel cancel)
querySqlFields in interface GridQueryIndexingpublic UpdateResult mapDistributedUpdate(String schemaName, SqlFieldsQuery fldsQry, IndexingQueryFilter filter, GridQueryCancel cancel, boolean local) throws IgniteCheckedException
schemaName - Schema name.fldsQry - Query.filter - Filter.cancel - Cancel state.local - Locality flag.IgniteCheckedException - if failed.public boolean registerType(GridCacheContext cctx, GridQueryTypeDescriptor type) throws IgniteCheckedException
registerType in interface GridQueryIndexingtype - Type description.IgniteCheckedException - In case of error.public GridH2Table dataTable(String schemaName, String tblName)
schemaName - Schema name.tblName - Table name.null if none found.public GridH2Table dataTable(QueryTable tbl)
tbl - Identifier.null if none found.public void removeDataTable(GridH2Table h2Tbl)
h2Tbl - Remove data table.public GridH2Table dataTableForIndex(String schemaName, String idxName)
schemaName - Schema name.idxName - Index name.null if index is not found.public String schema(String cacheName)
schema in interface GridQueryIndexingpublic void checkStatementStreamable(PreparedStatement nativeStmt)
checkStatementStreamable in interface GridQueryIndexingpublic GridQueryRowCacheCleaner rowCacheCleaner(int grpId)
rowCacheCleaner in interface GridQueryIndexingpublic void rebuildIndexesFromHash(String cacheName) throws IgniteCheckedException
rebuildIndexesFromHash in interface GridQueryIndexingcacheName - Cache name.IgniteCheckedException - If failed.public void markForRebuildFromHash(String cacheName)
markForRebuildFromHash in interface GridQueryIndexingpublic GridSpinBusyLock busyLock()
public GridMapQueryExecutor mapQueryExecutor()
public GridReduceQueryExecutor reduceQueryExecutor()
public void start(GridKernalContext ctx, GridSpinBusyLock busyLock) throws IgniteCheckedException
start in interface GridQueryIndexingIgniteCheckedExceptionpublic CacheObjectValueContext objectContext()
public boolean send(Object topic, int topicOrd, Collection<ClusterNode> nodes, Message msg, @Nullable IgniteBiClosure<ClusterNode,Message,Message> specialize, @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 void stop()
throws IgniteCheckedException
stop in interface GridQueryIndexingIgniteCheckedExceptionpublic void registerCache(String cacheName, String schemaName, GridCacheContext<?,?> cctx) throws IgniteCheckedException
registerCache in interface GridQueryIndexingIgniteCheckedExceptionpublic void unregisterCache(GridCacheContext cctx, boolean rmvIdx)
unregisterCache in interface GridQueryIndexingpublic IndexingQueryFilter backupFilter(@Nullable AffinityTopologyVersion topVer, @Nullable int[] parts)
backupFilter in interface GridQueryIndexingpublic 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 Collection<GridRunningQueryInfo> runningQueries(long duration)
runningQueries in interface GridQueryIndexingpublic void cancelQueries(Collection<Long> queries)
cancelQueries in interface GridQueryIndexingpublic void cancelAllQueries()
cancelAllQueries in interface GridQueryIndexingpublic Map<Thread,Connection> perThreadConnections()
@Nullable public List<Integer> collectCacheIds(@Nullable Integer mainCacheId, GridCacheTwoStepQuery twoStepQry)
mainCacheId - Id of main cache.twoStepQry - Two-step query.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.6.0 Release Date : July 10 2018