forked from apache/shardingsphere
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ModeContextManager interface and split ClusterModeContextManager …
…and StandaloneModeContextManager (apache#23061) * Add ModeContextManager and split ClusterModeContextManager and StandaloneModeContextManager * Refactor alterRuleConfiguration logic * Fix checkstyle * Fix checkstyle * Fix it * Fix unit test * Add synchronized * Fix checkstyle
- Loading branch information
1 parent
4b5424d
commit 34a5db9
Showing
32 changed files
with
535 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
...ommon/src/main/java/org/apache/shardingsphere/infra/instance/mode/ModeContextManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.shardingsphere.infra.instance.mode; | ||
|
||
import org.apache.shardingsphere.infra.config.rule.RuleConfiguration; | ||
import org.apache.shardingsphere.infra.datasource.props.DataSourceProperties; | ||
|
||
import java.sql.SQLException; | ||
import java.util.Collection; | ||
import java.util.Map; | ||
import java.util.Properties; | ||
|
||
/** | ||
* Mode context manager. | ||
*/ | ||
public interface ModeContextManager { | ||
|
||
/** | ||
* Create database. | ||
* | ||
* @param databaseName database name | ||
*/ | ||
void createDatabase(String databaseName); | ||
|
||
/** | ||
* Drop database. | ||
* | ||
* @param databaseName database name | ||
*/ | ||
void dropDatabase(String databaseName); | ||
|
||
/** | ||
* Register storage units. | ||
* | ||
* @param databaseName database name | ||
* @param toBeRegisterStorageUnitProps to be register storage unit props | ||
* @throws SQLException SQL exception | ||
*/ | ||
void registerStorageUnits(String databaseName, Map<String, DataSourceProperties> toBeRegisterStorageUnitProps) throws SQLException; | ||
|
||
/** | ||
* Alter storage units. | ||
* | ||
* @param databaseName database name | ||
* @param toBeUpdatedStorageUnitProps to be updated storage unit props | ||
* @throws SQLException SQL exception | ||
*/ | ||
void alterStorageUnits(String databaseName, Map<String, DataSourceProperties> toBeUpdatedStorageUnitProps) throws SQLException; | ||
|
||
/** | ||
* Unregister storage units. | ||
* @param databaseName database name | ||
* @param toBeDroppedStorageUnitNames to be dropped storage unit names | ||
* @throws SQLException SQL exception | ||
*/ | ||
void unregisterStorageUnits(String databaseName, Collection<String> toBeDroppedStorageUnitNames) throws SQLException; | ||
|
||
/** | ||
* Alter rule configuration. | ||
* | ||
* @param databaseName database name | ||
* @param ruleConfigs rule configs | ||
*/ | ||
void alterRuleConfiguration(String databaseName, Collection<RuleConfiguration> ruleConfigs); | ||
|
||
/** | ||
* Alter global rule configuration. | ||
* | ||
* @param globalRuleConfigs global rule configs | ||
*/ | ||
void alterGlobalRuleConfiguration(Collection<RuleConfiguration> globalRuleConfigs); | ||
|
||
/** | ||
* Alter properties. | ||
* | ||
* @param props pros | ||
*/ | ||
void alterProperties(Properties props); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.