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)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(String schemaName,
String tblName,
List<QueryField> cols,
boolean ifTblExists,
boolean ifColNotExists)
Add column.
|
void |
addIndex(TableDescriptor tbl,
IndexDescriptor idxDesc)
Add index to the schema.
|
Collection<IndexDescriptor> |
allIndexes() |
@Nullable GridCacheContextInfo<?,?> |
cacheInfo(String cacheName)
Find registered cache info by it's name.
|
boolean |
clearCacheContext(GridCacheContext<?,?> cctx)
Clear cache context on call cache.close() on non-affinity node.
|
Collection<ColumnInformation> |
columnsInformation(String schemaNamePtrn,
String tblNamePtrn,
String colNamePtrn)
Return column information filtered by given patterns.
|
void |
createIndex(String schemaName,
String tblName,
QueryIndexDescriptorImpl idxDesc,
boolean ifNotExists,
SchemaIndexCacheVisitor cacheVisitor)
Create index dynamically.
|
void |
createSystemView(String schema,
SystemView<?> view)
Registers new system view.
|
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.
|
static String |
generateProxyIdxName(String idxName) |
@Nullable IndexDescriptor |
index(String schemaName,
String idxName)
Find index by it's identifier.
|
boolean |
initCacheContext(GridCacheContext<?,?> cctx)
Initialize table's cache context created for not started cache.
|
void |
markIndexRebuild(String cacheName,
boolean mark)
Mark tables for index rebuild, so that their indexes are not used.
|
void |
onCacheCreated(String cacheName,
String schemaName,
Class<?>[] sqlFuncs)
Invoked when cache is created.
|
void |
onCacheDestroyed(String cacheName,
boolean rmvIdx,
boolean clearIdx)
Handle cache destroy.
|
void |
onCacheTypeCreated(GridCacheContextInfo<?,?> cacheInfo,
GridQueryTypeDescriptor type,
boolean isSql)
Registers new class description.
|
static void |
registerIndexDescriptorFactory(QueryIndexType type,
IndexDescriptorFactory factory)
Register index descriptor factory for custom index type.
|
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.
|
@Nullable TableDescriptor |
table(String schemaName,
String tblName)
Find table by it's identifier.
|
Collection<TableDescriptor> |
tablesForCache(String cacheName)
Gets collection of table for given schema name.
|
Collection<TableInformation> |
tablesInformation(String schemaNamePtrn,
String tblNamePtrn,
String... tblTypes)
Return table information filtered by given patterns.
|
@Nullable GridQueryTypeDescriptor |
typeDescriptorForType(String schemaName,
String cacheName,
String type)
Get table descriptor.
|
static void |
unregisterIndexDescriptorFactory(QueryIndexType type)
Unregister index descriptor factory for custom index type.
|
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)
ctx - Kernal context.public static void registerIndexDescriptorFactory(QueryIndexType type, IndexDescriptorFactory factory)
public static void unregisterIndexDescriptorFactory(QueryIndexType type)
public void start(String[] schemaNames) throws IgniteCheckedException
schemaNames - Schema names.IgniteCheckedExceptionpublic void stop()
public void createSystemView(String schema, SystemView<?> view)
schema - Schema to create view in.view - System view.public 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, GridQueryTypeDescriptor type, boolean isSql) throws IgniteCheckedException
cacheInfo - Cache info.type - Type descriptor.isSql - Whether SQL enabled.IgniteCheckedException - If failed.public void onCacheDestroyed(String cacheName, boolean rmvIdx, boolean clearIdx)
cacheName - Cache name.rmvIdx - 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 addIndex(TableDescriptor tbl, IndexDescriptor idxDesc) throws IgniteCheckedException
tbl - Table descriptor.idxDesc - Index descriptor.IgniteCheckedExceptionpublic void dropIndex(String schemaName, String idxName, boolean ifExists) throws IgniteCheckedException
schemaName - Schema name.idxName - Index name.ifExists - If exists.IgniteCheckedExceptionpublic 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.public boolean initCacheContext(GridCacheContext<?,?> cctx)
cctx - Cache context.true If context has been initialized.public boolean clearCacheContext(GridCacheContext<?,?> cctx)
cctx - Cache context.true If context has been cleared.public void markIndexRebuild(String cacheName, boolean mark)
cacheName - Cache name.mark - Mark/unmark flag, true if index rebuild started, false if finished.@Nullable public @Nullable GridQueryTypeDescriptor typeDescriptorForType(String schemaName, String cacheName, String type)
schemaName - Schema name.cacheName - Cache name.type - Type name.public Collection<TableDescriptor> tablesForCache(String cacheName)
cacheName - Cache name.@Nullable public @Nullable GridCacheContextInfo<?,?> cacheInfo(String cacheName)
@Nullable public @Nullable TableDescriptor table(String schemaName, String tblName)
schemaName - Schema name.tblName - Table name.null if none found.@Nullable public @Nullable IndexDescriptor index(String schemaName, String idxName)
schemaName - Schema name.idxName - Index name.null if none found.public Collection<IndexDescriptor> allIndexes()
public Collection<TableInformation> tablesInformation(String schemaNamePtrn, String tblNamePtrn, String... tblTypes)
schemaNamePtrn - Filter by schema name. Can be null to don't use the filter.tblNamePtrn - Filter by table name. Can be null to don't use the filter.tblTypes - Filter by table type. As Of now supported only 'TABLES' and 'VIEWS'.
Can be null or empty to don't use the filter.public Collection<ColumnInformation> columnsInformation(String schemaNamePtrn, String tblNamePtrn, String colNamePtrn)
schemaNamePtrn - Filter by schema name. Can be null to don't use the filter.tblNamePtrn - Filter by table name. Can be null to don't use the filter.colNamePtrn - Filter by column name. Can be null to don't use the filter.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.15.0 Release Date : April 25 2023