Skip to content

Commit

Permalink
Refactor MetaDataContextsFactory (#34393)
Browse files Browse the repository at this point in the history
* Refactor MetaDataContextsFactory

* Refactor MetaDataContextsFactory
  • Loading branch information
terrymanu authored Jan 18, 2025
1 parent 670436a commit ce51aed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions distribution/proxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

FROM alpine AS prepare

ARG APP_NAME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
import org.apache.shardingsphere.infra.database.DatabaseTypeEngine;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
import org.apache.shardingsphere.infra.datasource.pool.config.DataSourceConfiguration;
import org.apache.shardingsphere.infra.datasource.pool.destroyer.DataSourcePoolDestroyer;
import org.apache.shardingsphere.infra.datasource.pool.props.domain.DataSourcePoolProperties;
Expand Down Expand Up @@ -253,10 +254,10 @@ public static ShardingSphereDatabase createChangedDatabase(final String database
private static ShardingSphereDatabase createChangedDatabase(final String databaseName, final boolean internalLoadMetaData, final MetaDataPersistService persistService,
final DatabaseConfiguration databaseConfig, final ConfigurationProperties props,
final ComputeNodeInstanceContext instanceContext) throws SQLException {
DatabaseType protocolType = DatabaseTypeEngine.getProtocolType(databaseConfig, props);
return internalLoadMetaData
? ShardingSphereDatabase.create(databaseName, DatabaseTypeEngine.getProtocolType(databaseConfig, props),
databaseConfig, instanceContext, persistService.getDatabaseMetaDataFacade().getSchema().load(databaseName))
: ShardingSphereDatabase.create(databaseName, DatabaseTypeEngine.getProtocolType(databaseConfig, props), databaseConfig, props, instanceContext);
? ShardingSphereDatabase.create(databaseName, protocolType, databaseConfig, instanceContext, persistService.getDatabaseMetaDataFacade().getSchema().load(databaseName))
: ShardingSphereDatabase.create(databaseName, protocolType, databaseConfig, props, instanceContext);
}

private static ResourceMetaData getEffectiveResourceMetaData(final ShardingSphereDatabase database, final SwitchingResource resource) {
Expand Down

0 comments on commit ce51aed

Please sign in to comment.