You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/09/08 05:09:36 UTC
[GitHub] [shardingsphere] strongduanmu commented on a diff in pull request #20770: Support using disabled data source at startup(#20738)
strongduanmu commented on code in PR #20770:
URL: https://github.com/apache/shardingsphere/pull/20770#discussion_r965506178
##########
shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/arguments/BootstrapArguments.java:
##########
@@ -74,6 +74,19 @@ public List<String> getAddresses() {
return args.length < 3 ? Collections.singletonList(DEFAULT_BIND_ADDRESS) : Arrays.asList(args[2].split(","));
}
+ /**
+ * Get force startup parameter.
+ *
+ * @return force parameter
+ */
+ public boolean getForce() {
+ return args.length >= 4 && parseForceParameter(args[3]);
+ }
+
+ private boolean parseForceParameter(final String forceParam) {
+ return forceParam.trim().equals("-f");
Review Comment:
Can we start up Proxy with start.sh?
##########
shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeEngine.java:
##########
@@ -44,12 +44,14 @@ public final class DatabaseTypeEngine {
/**
* Get protocol type.
*
+ *
+ * @param databaseName database name
* @param databaseConfig database configuration
* @param props props
* @return protocol type
*/
- public static DatabaseType getProtocolType(final DatabaseConfiguration databaseConfig, final ConfigurationProperties props) {
- return findConfiguredDatabaseType(props).orElseGet(() -> getDatabaseType(databaseConfig.getDataSources().values()));
+ public static DatabaseType getProtocolType(final String databaseName, final DatabaseConfiguration databaseConfig, final ConfigurationProperties props) {
+ return findConfiguredDatabaseType(props).orElseGet(() -> getDatabaseType(DataSourceStateManager.getInstance().getNonDisabledDataSources(databaseName, databaseConfig)));
Review Comment:
Do you think `getEnabledDataSources` is better?
##########
shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/instance/metadata/jdbc/JDBCInstanceMetaData.java:
##########
@@ -32,9 +32,18 @@ public final class JDBCInstanceMetaData implements InstanceMetaData {
private final String ip;
+ private final boolean force;
Review Comment:
Why add force in JDBCInstanceMetaData?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org