public class IgniteH2Indexing extends Object implements GridQueryIndexing
"" will be used. To avoid name conflicts user should not explicitly name
a schema "".
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 |
|---|---|
static String |
KEY_FIELD_NAME
Field name for key.
|
static String |
VAL_FIELD_NAME
Field name for value.
|
| Constructor and Description |
|---|
IgniteH2Indexing() |
public static final String KEY_FIELD_NAME
public static final String VAL_FIELD_NAME
public Connection connectionForSpace(@Nullable String space)
space - Space.public void executeStatement(String schema, String sql) throws IgniteCheckedException
schema - Schemasql - SQL statement.IgniteCheckedException - If failed.public void store(@Nullable String spaceName, GridQueryTypeDescriptor type, CacheObject k, CacheObject v, byte[] ver, long expirationTime) throws IgniteCheckedException
store in interface GridQueryIndexingIgniteCheckedExceptionpublic void remove(@Nullable String spaceName, CacheObject key, CacheObject val) throws IgniteCheckedException
remove in interface GridQueryIndexingIgniteCheckedExceptionpublic void onSwap(@Nullable String spaceName, CacheObject key) throws IgniteCheckedException
onSwap in interface GridQueryIndexingIgniteCheckedExceptionpublic void onUnswap(@Nullable String spaceName, CacheObject key, CacheObject val) throws IgniteCheckedException
onUnswap in interface GridQueryIndexingIgniteCheckedExceptionpublic <K,V> GridCloseableIterator<IgniteBiTuple<K,V>> queryText(@Nullable String spaceName, String qry, GridQueryTypeDescriptor type, IndexingQueryFilter filters) throws IgniteCheckedException
queryText in interface GridQueryIndexingIgniteCheckedExceptionpublic void unregisterType(@Nullable String spaceName, GridQueryTypeDescriptor type) throws IgniteCheckedException
unregisterType in interface GridQueryIndexingIgniteCheckedExceptionpublic GridQueryFieldsResult queryFields(@Nullable String spaceName, String qry, @Nullable Collection<Object> params, IndexingQueryFilter filters) throws IgniteCheckedException
queryFields in interface GridQueryIndexingIgniteCheckedExceptionpublic ResultSet executeSqlQueryWithTimer(String space, Connection conn, String sql, @Nullable Collection<Object> params, boolean useStmtCache) throws IgniteCheckedException
space - Space name.conn - Connection,.sql - Sql query.params - Parameters.useStmtCache - If true uses statement cache.IgniteCheckedException - If failed.public void bindParameters(PreparedStatement stmt, @Nullable Collection<Object> params) throws IgniteCheckedException
stmt - Prepared statement.params - Parameters collection.IgniteCheckedException - If failed.public <K,V> GridCloseableIterator<IgniteBiTuple<K,V>> query(@Nullable String spaceName, String qry, @Nullable Collection<Object> params, GridQueryTypeDescriptor type, IndexingQueryFilter filters) throws IgniteCheckedException
query in interface GridQueryIndexingspaceName - Space name.qry - Query.params - Query parameters.type - Query return type.filters - Space name and key filters.IgniteCheckedException - If failed.public Iterable<List<?>> queryTwoStep(GridCacheContext<?,?> cctx, GridCacheTwoStepQuery qry, boolean keepCacheObj)
queryTwoStep in interface GridQueryIndexingpublic <K,V> QueryCursor<javax.cache.Cache.Entry<K,V>> queryTwoStep(GridCacheContext<?,?> cctx, SqlQuery qry)
queryTwoStep in interface GridQueryIndexingpublic QueryCursor<List<?>> queryTwoStep(GridCacheContext<?,?> cctx, SqlFieldsQuery qry)
queryTwoStep in interface GridQueryIndexingpublic void setFilters(@Nullable IndexingQueryFilter filters)
filters - Filters.public boolean registerType(@Nullable String spaceName, GridQueryTypeDescriptor type) throws IgniteCheckedException
registerType in interface GridQueryIndexingtype - Type description.IgniteCheckedException - In case of error.public String space(String schemaName)
schemaName - Schema name. Could not be null. Could be empty.public void rebuildIndexes(@Nullable String spaceName, GridQueryTypeDescriptor type)
rebuildIndexes in interface GridQueryIndexingpublic long size(@Nullable String spaceName, GridQueryTypeDescriptor type, IndexingQueryFilter filters) throws IgniteCheckedException
size in interface GridQueryIndexingIgniteCheckedExceptionpublic GridMapQueryExecutor mapQueryExecutor()
public GridReduceQueryExecutor reduceQueryExecutor()
public void start(GridKernalContext ctx, GridSpinBusyLock busyLock) throws IgniteCheckedException
start in interface GridQueryIndexingIgniteCheckedExceptionprotected org.h2.api.JavaObjectSerializer h2Serializer()
public void stop()
throws IgniteCheckedException
stop in interface GridQueryIndexingIgniteCheckedExceptionpublic void registerCache(CacheConfiguration<?,?> ccfg) throws IgniteCheckedException
registerCache in interface GridQueryIndexingIgniteCheckedExceptionpublic void unregisterCache(CacheConfiguration<?,?> ccfg)
unregisterCache in interface GridQueryIndexingpublic IndexingQueryFilter backupFilter(@Nullable List<String> caches, @Nullable AffinityTopologyVersion topVer, @Nullable int[] parts)
backupFilter in interface GridQueryIndexingpublic AffinityTopologyVersion readyTopologyVersion()
public void awaitForReadyTopologyVersion(AffinityTopologyVersion topVer) throws IgniteCheckedException
topVer - Topology version.IgniteCheckedException - If failed.public void onDisconnected(IgniteFuture<?> reconnectFut)
onDisconnected in interface GridQueryIndexing
Follow @ApacheIgnite
Ignite Fabric : ver. 1.6.0 Release Date : May 18 2016