public class SchemaManager extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
SQL_IDXS_VIEW |
static String |
SQL_IDXS_VIEW_DESC |
static String |
SQL_SCHEMA_VIEW |
static String |
SQL_SCHEMA_VIEW_DESC |
static String |
SQL_TBL_COLS_VIEW |
static String |
SQL_TBL_COLS_VIEW_DESC |
static String |
SQL_TBLS_VIEW |
static String |
SQL_TBLS_VIEW_DESC |
static String |
SQL_VIEW_COLS_VIEW |
static String |
SQL_VIEW_COLS_VIEW_DESC |
static String |
SQL_VIEWS_VIEW |
static String |
SQL_VIEWS_VIEW_DESC |
| Constructor and Description |
|---|
SchemaManager(GridKernalContext ctx,
ConnectionManager connMgr)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(String schemaName,
String tblName,
List<QueryField> cols,
boolean ifTblExists,
boolean ifColNotExists)
Add column.
|
void |
createIndex(GridH2Table h2Tbl,
H2TableDescriptor desc,
String schemaName,
GridH2IndexBase h2Idx,
boolean ifNotExists,
SchemaIndexCacheVisitor cacheVisitor)
Creates index.
|
void |
createIndex(String schemaName,
String tblName,
QueryIndexDescriptorImpl idxDesc,
boolean ifNotExists,
SchemaIndexCacheVisitor cacheVisitor)
Create index.
|
void |
createSystemView(String schema,
SqlSystemView view)
Registers new system view.
|
GridH2Table |
dataTable(String schemaName,
String tblName)
Find table by it's identifier.
|
GridH2Table |
dataTableForIndex(String schemaName,
String idxName)
Find table for index.
|
Collection<GridH2Table> |
dataTables() |
void |
dropColumn(String schemaName,
String tblName,
List<String> cols,
boolean ifTblExists,
boolean ifColExists)
Drop column.
|
void |
dropIndex(String schemaName,
String idxName,
boolean ifExists)
Drop index.
|
void |
onCacheCreated(String cacheName,
String schemaName,
Class<?>[] sqlFuncs)
Invoked when cache is created.
|
void |
onCacheDestroyed(String cacheName,
boolean destroy,
boolean clearIdx)
Handle cache destroy.
|
void |
onCacheTypeCreated(GridCacheContextInfo cacheInfo,
IgniteH2Indexing idx,
GridQueryTypeDescriptor type,
boolean isSql)
Registers new class description.
|
void |
registerDropColumnsListener(@NotNull BiConsumer<GridH2Table,List<String>> lsnr)
Register listener for drop columns event.
|
void |
registerDropTableListener(@NotNull BiConsumer<String,String> lsnr)
Register listener for drop table event.
|
String |
schemaName(String cacheName)
Get schema name for cache.
|
Set<String> |
schemaNames()
Get schemas names.
|
void |
start(String[] schemaNames)
Handle node start.
|
void |
stop()
Handle node stop.
|
Collection<SqlSystemView> |
systemViews() |
@Nullable H2TableDescriptor |
tableForType(String schemaName,
String cacheName,
String type)
Get table descriptor.
|
Collection<H2TableDescriptor> |
tablesForCache(String cacheName)
Gets collection of table for given schema name.
|
void |
unregisterDropColumnsListener(@NotNull BiConsumer<GridH2Table,List<String>> lsnr)
Unregister listener for drop columns event.
|
void |
unregisterDropTableListener(@NotNull BiConsumer<String,String> lsnr)
Unregister listener for drop table event.
|
public static final String SQL_SCHEMA_VIEW
public static final String SQL_SCHEMA_VIEW_DESC
public static final String SQL_TBLS_VIEW
public static final String SQL_TBLS_VIEW_DESC
public static final String SQL_VIEWS_VIEW
public static final String SQL_VIEWS_VIEW_DESC
public static final String SQL_IDXS_VIEW
public static final String SQL_IDXS_VIEW_DESC
public static final String SQL_TBL_COLS_VIEW
public static final String SQL_TBL_COLS_VIEW_DESC
public static final String SQL_VIEW_COLS_VIEW
public static final String SQL_VIEW_COLS_VIEW_DESC
public SchemaManager(GridKernalContext ctx, ConnectionManager connMgr)
ctx - Kernal context.connMgr - Connection manager.public void start(String[] schemaNames) throws IgniteCheckedException
schemaNames - Schema names.IgniteCheckedExceptionpublic void stop()
public void createSystemView(String schema, SqlSystemView view) throws IgniteCheckedException
schema - Schema to create view in.view - System view.IgniteCheckedExceptionpublic void onCacheCreated(String cacheName, String schemaName, Class<?>[] sqlFuncs) throws IgniteCheckedException
cacheName - Cache name.schemaName - Schema name.sqlFuncs - Custom SQL functions.IgniteCheckedException - If failed.public void onCacheTypeCreated(GridCacheContextInfo cacheInfo, IgniteH2Indexing idx, GridQueryTypeDescriptor type, boolean isSql) throws IgniteCheckedException
cacheInfo - Cache info.idx - Indexing.type - Type descriptor.isSql - Whether SQL enabled.IgniteCheckedException - If failed.public void onCacheDestroyed(String cacheName, boolean destroy, boolean clearIdx)
cacheName - Cache name.destroy - Whether to remove indexes.clearIdx - Whether to clear the index.public String schemaName(String cacheName)
cacheName - Cache name.public void createIndex(String schemaName, String tblName, QueryIndexDescriptorImpl idxDesc, boolean ifNotExists, SchemaIndexCacheVisitor cacheVisitor) throws IgniteCheckedException
schemaName - Schema name.tblName - Table name.idxDesc - Index descriptor.ifNotExists - If-not-exists.cacheVisitor - Cache visitor.IgniteCheckedException - If failed.public void createIndex(GridH2Table h2Tbl, H2TableDescriptor desc, String schemaName, GridH2IndexBase h2Idx, boolean ifNotExists, SchemaIndexCacheVisitor cacheVisitor) throws IgniteCheckedException
h2Tbl - Table.desc - Table descriptor.schemaName - Schema name.h2Idx - Index.ifNotExists - If-not-exists.cacheVisitor - Cache visitor.IgniteCheckedException - If failed.public void dropIndex(String schemaName, String idxName, boolean ifExists) throws IgniteCheckedException
schemaName - Schema name.idxName - Index name.ifExists - If exists.IgniteCheckedException - If failed.public void addColumn(String schemaName, String tblName, List<QueryField> cols, boolean ifTblExists, boolean ifColNotExists) throws IgniteCheckedException
schemaName - Schema name.tblName - Table name.cols - Columns.ifTblExists - If table exists.ifColNotExists - If column not exists.IgniteCheckedException - If failed.public void dropColumn(String schemaName, String tblName, List<String> cols, boolean ifTblExists, boolean ifColExists) throws IgniteCheckedException
schemaName - Schema name.tblName - Table name.cols - Columns.ifTblExists - If table exists.ifColExists - If column exists.IgniteCheckedException - If failed.@Nullable public @Nullable H2TableDescriptor tableForType(String schemaName, String cacheName, String type)
schemaName - Schema name.cacheName - Cache name.type - Type name.public Collection<H2TableDescriptor> tablesForCache(String cacheName)
cacheName - Cache name.public GridH2Table dataTable(String schemaName, String tblName)
schemaName - Schema name.tblName - Table name.null if none found.public Collection<GridH2Table> dataTables()
public Collection<SqlSystemView> systemViews()
public GridH2Table dataTableForIndex(String schemaName, String idxName)
schemaName - Schema name.idxName - Index name.null if index is not found.public void registerDropColumnsListener(@NotNull
@NotNull BiConsumer<GridH2Table,List<String>> lsnr)
lsnr - Drop columns event listener.public void unregisterDropColumnsListener(@NotNull
@NotNull BiConsumer<GridH2Table,List<String>> lsnr)
lsnr - Drop columns event listener.public void registerDropTableListener(@NotNull
@NotNull BiConsumer<String,String> lsnr)
lsnr - Drop table event listener.public void unregisterDropTableListener(@NotNull
@NotNull BiConsumer<String,String> lsnr)
lsnr - Drop table event listener.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 8.9.23-p1 Release Date : November 19 2025