public final class ContextManager extends Object implements AutoCloseable
| Constructor and Description |
|---|
ContextManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addResource(String schemaName,
Map<String,org.apache.shardingsphere.infra.datasource.props.DataSourceProperties> dataSourcePropsMap)
Add resource.
|
void |
addSchema(String schemaName)
Add schema.
|
void |
alterDataSourceAndRuleConfiguration(String schemaName,
Map<String,org.apache.shardingsphere.infra.datasource.props.DataSourceProperties> dataSourcePropsMap,
Collection<org.apache.shardingsphere.infra.config.RuleConfiguration> ruleConfigs)
Alter data source and rule configuration.
|
void |
alterDataSourceConfiguration(String schemaName,
Map<String,org.apache.shardingsphere.infra.datasource.props.DataSourceProperties> dataSourcePropsMap)
Alter data source configuration.
|
void |
alterGlobalRuleConfiguration(Collection<org.apache.shardingsphere.infra.config.RuleConfiguration> ruleConfigs)
Alter global rule configuration.
|
void |
alterProperties(Properties props)
Alter properties.
|
void |
alterResource(String schemaName,
Map<String,org.apache.shardingsphere.infra.datasource.props.DataSourceProperties> dataSourcePropsMap)
Alter resource.
|
void |
alterRuleConfiguration(String schemaName,
Collection<org.apache.shardingsphere.infra.config.RuleConfiguration> ruleConfigs)
Alter rule configuration.
|
void |
alterSchema(String schemaName,
Map<String,org.apache.shardingsphere.infra.metadata.schema.ShardingSphereSchema> schemas)
Alter schema.
|
void |
alterSchema(String schemaName,
org.apache.shardingsphere.infra.metadata.schema.model.TableMetaData changedTableMetaData,
String deletedTable)
Alter schema.
|
void |
close() |
void |
deleteSchema(String schemaName)
Delete schema.
|
void |
dropResource(String schemaName,
Collection<String> toBeDroppedResourceNames)
Drop resource.
|
Map<String,DataSource> |
getDataSourceMap(String schemaName)
Get data source map.
|
void |
init(MetaDataContexts metaDataContexts,
org.apache.shardingsphere.transaction.context.TransactionContexts transactionContexts,
org.apache.shardingsphere.infra.instance.InstanceContext instanceContext)
Initialize context manager.
|
void |
reloadMetaData(String schemaName)
Reload meta data.
|
void |
reloadMetaData(String schemaName,
String tableName)
Reload table meta data.
|
void |
reloadMetaData(String schemaName,
String tableName,
String dataSourceName)
Reload single data source table meta data.
|
void |
renewAllTransactionContext()
Reload all transaction context.
|
void |
renewMetaDataContexts(MetaDataContexts metaDataContexts)
Renew meta data contexts.
|
void |
renewTransactionContexts(org.apache.shardingsphere.transaction.context.TransactionContexts transactionContexts)
Renew transaction contexts.
|
public void init(MetaDataContexts metaDataContexts, org.apache.shardingsphere.transaction.context.TransactionContexts transactionContexts, org.apache.shardingsphere.infra.instance.InstanceContext instanceContext)
metaDataContexts - meta data contextstransactionContexts - transaction contextsinstanceContext - instance contextpublic Map<String,DataSource> getDataSourceMap(String schemaName)
schemaName - schema namepublic void renewMetaDataContexts(MetaDataContexts metaDataContexts)
metaDataContexts - meta data contextspublic void renewTransactionContexts(org.apache.shardingsphere.transaction.context.TransactionContexts transactionContexts)
transactionContexts - transaction contextspublic void addSchema(String schemaName) throws SQLException
schemaName - schema nameSQLException - SQL exceptionpublic void alterSchema(String schemaName, Map<String,org.apache.shardingsphere.infra.metadata.schema.ShardingSphereSchema> schemas)
schemaName - schema nameschemas - schemaspublic void alterSchema(String schemaName, org.apache.shardingsphere.infra.metadata.schema.model.TableMetaData changedTableMetaData, String deletedTable)
schemaName - schema namechangedTableMetaData - changed table meta datadeletedTable - deleted tablepublic void deleteSchema(String schemaName)
schemaName - schema namepublic void addResource(String schemaName, Map<String,org.apache.shardingsphere.infra.datasource.props.DataSourceProperties> dataSourcePropsMap) throws SQLException
schemaName - schema namedataSourcePropsMap - data source properties mapSQLException - SQL exceptionpublic void alterResource(String schemaName, Map<String,org.apache.shardingsphere.infra.datasource.props.DataSourceProperties> dataSourcePropsMap) throws SQLException
schemaName - schema namedataSourcePropsMap - data source properties mapSQLException - SQL exceptionpublic void dropResource(String schemaName, Collection<String> toBeDroppedResourceNames)
schemaName - schema nametoBeDroppedResourceNames - to be dropped resource namespublic void alterRuleConfiguration(String schemaName, Collection<org.apache.shardingsphere.infra.config.RuleConfiguration> ruleConfigs)
schemaName - schema nameruleConfigs - collection of rule configurationspublic void alterDataSourceConfiguration(String schemaName, Map<String,org.apache.shardingsphere.infra.datasource.props.DataSourceProperties> dataSourcePropsMap)
schemaName - schema namedataSourcePropsMap - altered data source properties mappublic void alterDataSourceAndRuleConfiguration(String schemaName, Map<String,org.apache.shardingsphere.infra.datasource.props.DataSourceProperties> dataSourcePropsMap, Collection<org.apache.shardingsphere.infra.config.RuleConfiguration> ruleConfigs)
schemaName - schema namedataSourcePropsMap - data source props mapruleConfigs - rule configurationspublic void alterGlobalRuleConfiguration(Collection<org.apache.shardingsphere.infra.config.RuleConfiguration> ruleConfigs)
ruleConfigs - global rule configurationpublic void alterProperties(Properties props)
props - properties to be alteredpublic void reloadMetaData(String schemaName)
schemaName - schema name to be reloadpublic void reloadMetaData(String schemaName, String tableName)
schemaName - schema nametableName - logic table namepublic void reloadMetaData(String schemaName, String tableName, String dataSourceName)
schemaName - schema nametableName - logic table namedataSourceName - data source namepublic void renewAllTransactionContext()
public void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2022 The Apache Software Foundation. All rights reserved.