This is an automated email from the ASF dual-hosted git repository.
zhangliang 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 618dd5c Modify return value parameter to result (#6801)
618dd5c is described below
commit 618dd5c0eeec107602eddfd916e9e12f63c774b0
Author: Haoran Meng <[email protected]>
AuthorDate: Wed Aug 12 12:22:28 2020 +0800
Modify return value parameter to result (#6801)
---
.../org/apache/shardingsphere/cluster/facade/ClusterFacade.java | 6 +++---
.../cluster/heartbeat/detect/AbstractHeartbeatDetect.java | 4 ++--
.../shardingsphere/cluster/heartbeat/detect/HeartbeatDetect.java | 8 ++++----
.../cluster/heartbeat/detect/HeartbeatHandler.java | 4 ++--
.../orchestration/core/registry/RegistryCenterNode.java | 9 ---------
5 files changed, 11 insertions(+), 20 deletions(-)
diff --git
a/shardingsphere-control-panel/shardingsphere-cluster/shardingsphere-cluster-facade/src/main/java/org/apache/shardingsphere/cluster/facade/ClusterFacade.java
b/shardingsphere-control-panel/shardingsphere-cluster/shardingsphere-cluster-facade/src/main/java/org/apache/shardingsphere/cluster/facade/ClusterFacade.java
index 08cb2ac..7c847dd 100644
---
a/shardingsphere-control-panel/shardingsphere-cluster/shardingsphere-cluster-facade/src/main/java/org/apache/shardingsphere/cluster/facade/ClusterFacade.java
+++
b/shardingsphere-control-panel/shardingsphere-cluster/shardingsphere-cluster-facade/src/main/java/org/apache/shardingsphere/cluster/facade/ClusterFacade.java
@@ -93,9 +93,9 @@ public final class ClusterFacade {
}
private Map<String, DataSourceState> buildDataSourceStateMap(final
InstanceState instanceState, final HeartbeatResponse heartbeatResponse) {
- Map<String, DataSourceState> dataSourceStateMap = new HashMap<>();
- heartbeatResponse.getHeartbeatResultMap().forEach((key, value) ->
buildDataSourceState(key, value, dataSourceStateMap, instanceState));
- return dataSourceStateMap;
+ Map<String, DataSourceState> result = new HashMap<>();
+ heartbeatResponse.getHeartbeatResultMap().forEach((key, value) ->
buildDataSourceState(key, value, result, instanceState));
+ return result;
}
private void buildDataSourceState(final String schemaName, final
Collection<HeartbeatResult> heartbeatResults,
diff --git
a/shardingsphere-control-panel/shardingsphere-cluster/shardingsphere-cluster-heartbeat/src/main/java/org/apache/shardingsphere/cluster/heartbeat/detect/AbstractHeartbeatDetect.java
b/shardingsphere-control-panel/shardingsphere-cluster/shardingsphere-cluster-heartbeat/src/main/java/org/apache/shardingsphere/cluster/heartbeat/detect/AbstractHeartbeatDetect.java
index ff576fe..682a596 100644
---
a/shardingsphere-control-panel/shardingsphere-cluster/shardingsphere-cluster-heartbeat/src/main/java/org/apache/shardingsphere/cluster/heartbeat/detect/AbstractHeartbeatDetect.java
+++
b/shardingsphere-control-panel/shardingsphere-cluster/shardingsphere-cluster-heartbeat/src/main/java/org/apache/shardingsphere/cluster/heartbeat/detect/AbstractHeartbeatDetect.java
@@ -49,10 +49,10 @@ public abstract class AbstractHeartbeatDetect implements
Callable<Map<String, He
/**
* Build heart beat result.
*
- * @param result heart beat result
+ * @param heartbeatResult heart beat result
* @return heart beat result
*/
- protected abstract Map<String, HeartbeatResult> buildResult(boolean
result);
+ protected abstract Map<String, HeartbeatResult> buildResult(boolean
heartbeatResult);
@Override
public final Map<String, HeartbeatResult> call() {
diff --git
a/shardingsphere-control-panel/shardingsphere-cluster/shardingsphere-cluster-heartbeat/src/main/java/org/apache/shardingsphere/cluster/heartbeat/detect/HeartbeatDetect.java
b/shardingsphere-control-panel/shardingsphere-cluster/shardingsphere-cluster-heartbeat/src/main/java/org/apache/shardingsphere/cluster/heartbeat/detect/HeartbeatDetect.java
index 60bf1d7..e857432 100644
---
a/shardingsphere-control-panel/shardingsphere-cluster/shardingsphere-cluster-heartbeat/src/main/java/org/apache/shardingsphere/cluster/heartbeat/detect/HeartbeatDetect.java
+++
b/shardingsphere-control-panel/shardingsphere-cluster/shardingsphere-cluster-heartbeat/src/main/java/org/apache/shardingsphere/cluster/heartbeat/detect/HeartbeatDetect.java
@@ -70,9 +70,9 @@ public final class HeartbeatDetect extends
AbstractHeartbeatDetect {
}
@Override
- protected Map<String, HeartbeatResult> buildResult(final boolean result) {
- Map<String, HeartbeatResult> heartBeatResultMap = new HashMap<>(1, 1);
- heartBeatResultMap.put(schemaName, new HeartbeatResult(dataSourceName,
result, System.currentTimeMillis(), dataSourceDisabled));
- return heartBeatResultMap;
+ protected Map<String, HeartbeatResult> buildResult(final boolean
heartbeatResult) {
+ Map<String, HeartbeatResult> result = new HashMap<>(1, 1);
+ result.put(schemaName, new HeartbeatResult(dataSourceName,
heartbeatResult, System.currentTimeMillis(), dataSourceDisabled));
+ return result;
}
}
diff --git
a/shardingsphere-control-panel/shardingsphere-cluster/shardingsphere-cluster-heartbeat/src/main/java/org/apache/shardingsphere/cluster/heartbeat/detect/HeartbeatHandler.java
b/shardingsphere-control-panel/shardingsphere-cluster/shardingsphere-cluster-heartbeat/src/main/java/org/apache/shardingsphere/cluster/heartbeat/detect/HeartbeatHandler.java
index 748cd37e..d8e0a41 100644
---
a/shardingsphere-control-panel/shardingsphere-cluster/shardingsphere-cluster-heartbeat/src/main/java/org/apache/shardingsphere/cluster/heartbeat/detect/HeartbeatHandler.java
+++
b/shardingsphere-control-panel/shardingsphere-cluster/shardingsphere-cluster-heartbeat/src/main/java/org/apache/shardingsphere/cluster/heartbeat/detect/HeartbeatHandler.java
@@ -88,9 +88,9 @@ public final class HeartbeatHandler {
schemaContexts.forEach((key, value) ->
value.getSchema().getDataSources().forEach((innerKey, innerValue) -> {
futureTasks.add(executorService.submit(new HeartbeatDetect(key,
innerKey, innerValue, configuration, isDisabled(key, innerKey))));
}));
- HeartbeatResponse heartbeatResponse =
buildHeartbeatResponse(futureTasks);
+ HeartbeatResponse result = buildHeartbeatResponse(futureTasks);
closeExecutor(executorService);
- return heartbeatResponse;
+ return result;
}
/**
diff --git
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-registry/src/main/java/org/apache/shardingsphere/orchestration/core/registry/RegistryCenterNode.java
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-registry/src/main/java/org/apache/shardingsphere/orchestration/core/registry/RegistryCenterNode.java
index ef3a641..7fc2f75 100644
---
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-registry/src/main/java/org/apache/shardingsphere/orchestration/core/registry/RegistryCenterNode.java
+++
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-registry/src/main/java/org/apache/shardingsphere/orchestration/core/registry/RegistryCenterNode.java
@@ -46,15 +46,6 @@ public final class RegistryCenterNode {
}
/**
- * Get instance node root path.
- *
- * @return instance node root path
- */
- public String getInstanceNodeRootPath() {
- return Joiner.on("/").join("", name, ROOT, INSTANCES_NODE_PATH);
- }
-
- /**
* Get data source node full root path.
*
* @return data source node full root path