This is an automated email from the ASF dual-hosted git repository.
menghaoran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 2b463a7 Adjust keepAliveCron to keep-alive-cron and groupName to
group-name (#14117)
2b463a7 is described below
commit 2b463a7848e959503222b26b29a2a6bf9f726386
Author: zhaojinchao <[email protected]>
AuthorDate: Fri Dec 17 18:22:40 2021 +0800
Adjust keepAliveCron to keep-alive-cron and groupName to group-name (#14117)
---
.../shardingsphere/dbdiscovery/rule/DatabaseDiscoveryRule.java | 2 +-
.../shardingsphere/dbdiscovery/mgr/MGRDatabaseDiscoveryType.java | 2 +-
.../dbdiscovery/mgr/MGRDatabaseDiscoveryTypeTest.java | 4 ++--
.../src/main/resources/conf/config-database-discovery.yaml | 8 ++++----
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git
a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/rule/DatabaseDiscoveryRule.java
b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/rule/DatabaseDiscoveryRule.java
index 1f3b1c3..53a6f43 100644
---
a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/rule/DatabaseDiscoveryRule.java
+++
b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/rule/DatabaseDiscoveryRule.java
@@ -212,7 +212,7 @@ public final class DatabaseDiscoveryRule implements
SchemaRule, DataSourceContai
result.add(new
CronJob(entry.getValue().getDatabaseDiscoveryType().getType() + "-" +
entry.getValue().getName(),
each -> new HeartbeatJob(schemaName, dataSources,
entry.getValue().getName(), entry.getValue().getDatabaseDiscoveryType(),
entry.getValue().getDisabledDataSourceNames()).execute(null),
-
entry.getValue().getHeartbeatProps().getProperty("keepAliveCron")));
+
entry.getValue().getHeartbeatProps().getProperty("keep-alive-cron")));
}
return result;
}
diff --git
a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-provider/shardingsphere-db-discovery-mgr/src/main/java/org/apache/shardingsphere/dbdiscovery/mgr/MGRDatabaseDiscoveryType.java
b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-provider/shardingsphere-db-discovery-mgr/src/main/java/org/apache/shardingsphere/dbdiscovery/mgr/MGRDatabaseDiscoveryType.java
index 55d0948..af8b591 100644
---
a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-provider/shardingsphere-db-discovery-mgr/src/main/java/org/apache/shardingsphere/dbdiscovery/mgr/MGRDatabaseDiscoveryType.java
+++
b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-provider/shardingsphere-db-discovery-mgr/src/main/java/org/apache/shardingsphere/dbdiscovery/mgr/MGRDatabaseDiscoveryType.java
@@ -96,7 +96,7 @@ public final class MGRDatabaseDiscoveryType implements
DatabaseDiscoveryType {
try (ResultSet resultSet = statement.executeQuery(GROUP_NAME)) {
while (resultSet.next()) {
String serverGroupName = resultSet.getString("VARIABLE_VALUE");
- String ruleGroupName = props.getProperty("groupName");
+ String ruleGroupName = props.getProperty("group-name");
if (!serverGroupName.equals(ruleGroupName)) {
throw new ShardingSphereConfigurationException("MGR group
name is not consistent\n" + "serverGroupName: %s\nruleGroupName: %s",
serverGroupName, ruleGroupName);
}
diff --git
a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-provider/shardingsphere-db-discovery-mgr/src/test/java/org/apache/shardingsphere/dbdiscovery/mgr/MGRDatabaseDiscoveryTypeTest.java
b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-provider/shardingsphere-db-discovery-mgr/src/test/java/org/apache/shardingsphere/dbdiscovery/mgr/MGRDatabaseDiscoveryTypeTest.java
index 693c651..b961ddb 100644
---
a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-provider/shardingsphere-db-discovery-mgr/src/test/java/org/apache/shardingsphere/dbdiscovery/mgr/MGRDatabaseDiscoveryTypeTest.java
+++
b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-provider/shardingsphere-db-discovery-mgr/src/test/java/org/apache/shardingsphere/dbdiscovery/mgr/MGRDatabaseDiscoveryTypeTest.java
@@ -74,7 +74,7 @@ public final class MGRDatabaseDiscoveryTypeTest {
when(resultSet.getString("VARIABLE_VALUE")).thenReturn("group_name",
"ON");
Map<String, DataSource> dataSourceMap = mock(HashMap.class);
when(dataSourceMap.get(null)).thenReturn(dataSource);
- mgrHaType.getProps().setProperty("groupName", "group_name");
+ mgrHaType.getProps().setProperty("group-name", "group_name");
mgrHaType.checkDatabaseDiscoveryConfiguration("discovery_db",
dataSourceMap);
}
@@ -108,7 +108,7 @@ public final class MGRDatabaseDiscoveryTypeTest {
for (int i = 0; i < 3; i++) {
dataSourceMap.put(String.format("ds_%s", i), dataSources.get(i));
}
- mgrHaType.getProps().setProperty("groupName", "group_name");
+ mgrHaType.getProps().setProperty("group-name", "group_name");
mgrHaType.updatePrimaryDataSource("discovery_db", dataSourceMap,
Collections.emptySet(), "group_name");
assertThat(mgrHaType.getPrimaryDataSource(), is("ds_2"));
}
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/resources/conf/config-database-discovery.yaml
b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/resources/conf/config-database-discovery.yaml
index 287dd1d..bec443d 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/resources/conf/config-database-discovery.yaml
+++
b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/resources/conf/config-database-discovery.yaml
@@ -66,12 +66,12 @@
# discoveryHeartbeats:
# mgr-heartbeat:
# props:
-# keepAliveCron: '0/5 * * * * ?'
+# keep-alive-cron: '0/5 * * * * ?'
# discoveryTypes:
# mgr:
# type: MGR
# props:
-# groupName: 92504d5b-6dec-11e8-91ea-246e9612aaf1
+# group-name: 92504d5b-6dec-11e8-91ea-246e9612aaf1
######################################################################################################
#
@@ -123,9 +123,9 @@
# discoveryHeartbeats:
# mgr-heartbeat:
# props:
-# keepAliveCron: '0/5 * * * * ?'
+# keep-alive-cron: '0/5 * * * * ?'
# discoveryTypes:
# mgr:
# type: MGR
# props:
-# groupName: 92504d5b-6dec-11e8-91ea-246e9612aaf1
+# group-name: 92504d5b-6dec-11e8-91ea-246e9612aaf1