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/04/26 10:23:51 UTC

[GitHub] [shardingsphere] weihubeats commented on a diff in pull request #17049: optimization check highly available status

weihubeats commented on code in PR #17049:
URL: https://github.com/apache/shardingsphere/pull/17049#discussion_r858545940


##########
shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/algorithm/DatabaseDiscoveryEngine.java:
##########
@@ -93,27 +109,27 @@ private Optional<String> findPrimaryDataSourceName(final Map<String, DataSource>
         }
         return Optional.empty();
     }
-    
+
     private Map<String, DataSource> getActiveDataSourceMap(final Map<String, DataSource> dataSourceMap, final Collection<String> disabledDataSourceNames) {
         Map<String, DataSource> result = new HashMap<>(dataSourceMap);
         if (!disabledDataSourceNames.isEmpty()) {
             result.entrySet().removeIf(each -> disabledDataSourceNames.contains(each.getKey()));
         }
         return result;
     }
-    
+
     private void postReplicaDataSourceDisabledEvent(final String databaseName, final String groupName, final String primaryDataSourceName, final Map<String, DataSource> dataSourceMap) {
         for (Entry<String, DataSource> entry : dataSourceMap.entrySet()) {
             if (!entry.getKey().equals(primaryDataSourceName)) {
                 ShardingSphereEventBus.getInstance().post(new DataSourceDisabledEvent(databaseName, groupName, entry.getKey(), createStorageNodeDataSource(loadReplicaStatus(entry.getValue()))));
             }
         }
     }
-    
+
     private StorageNodeDataSource createStorageNodeDataSource(final ReplicaDataSourceStatus replicaStatus) {
         return new StorageNodeDataSource(StorageNodeRole.MEMBER, replicaStatus.isOnline() ? StorageNodeStatus.ENABLED : StorageNodeStatus.DISABLED, replicaStatus.getReplicationDelayMilliseconds());
     }
-    
+

Review Comment:
   have been processed



##########
shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/algorithm/DatabaseDiscoveryEngine.java:
##########
@@ -93,27 +109,27 @@ private Optional<String> findPrimaryDataSourceName(final Map<String, DataSource>
         }
         return Optional.empty();
     }
-    
+
     private Map<String, DataSource> getActiveDataSourceMap(final Map<String, DataSource> dataSourceMap, final Collection<String> disabledDataSourceNames) {
         Map<String, DataSource> result = new HashMap<>(dataSourceMap);
         if (!disabledDataSourceNames.isEmpty()) {
             result.entrySet().removeIf(each -> disabledDataSourceNames.contains(each.getKey()));
         }
         return result;
     }
-    
+
     private void postReplicaDataSourceDisabledEvent(final String databaseName, final String groupName, final String primaryDataSourceName, final Map<String, DataSource> dataSourceMap) {
         for (Entry<String, DataSource> entry : dataSourceMap.entrySet()) {
             if (!entry.getKey().equals(primaryDataSourceName)) {
                 ShardingSphereEventBus.getInstance().post(new DataSourceDisabledEvent(databaseName, groupName, entry.getKey(), createStorageNodeDataSource(loadReplicaStatus(entry.getValue()))));
             }
         }
     }
-    
+

Review Comment:
   have been processed



-- 
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