Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
c7ch23en committed Apr 13, 2020
1 parent a8e5882 commit d822000
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.ctrip.platform.dal.dao.client.DalConnectionLocator;
import com.ctrip.platform.dal.dao.cluster.DynamicCluster;
import com.ctrip.platform.dal.dao.helper.DalElementFactory;
import com.ctrip.platform.dal.dao.log.DalLogTypes;
import com.ctrip.platform.dal.dao.log.ILogger;

import java.util.List;
Expand Down Expand Up @@ -78,11 +79,18 @@ private ClusterDatabaseSet tryAdapt(DefaultDatabaseSet defaultDatabaseSet) {
String clusterName = clusterInfo.getClusterName();
ClusterConfig clusterConfig = clusterConfigProvider.getClusterConfig(clusterName);
Cluster cluster = new DynamicCluster(clusterConfig);
LOGGER.logEvent(DalLogTypes.DAL_VALIDATION, "ClusterAdaptSucceeded",
String.format("databaseSet: %s, clusterName: %s",
defaultDatabaseSet.getName(), clusterName));
return new ClusterDatabaseSet(defaultDatabaseSet.getName(), cluster, connectionLocator);
}
}
}
LOGGER.logEvent(DalLogTypes.DAL_VALIDATION, "ClusterAdaptSkipped", String.format("databaseSet: %s",
defaultDatabaseSet.getName()));
} catch (Throwable t) {
LOGGER.logEvent(DalLogTypes.DAL_VALIDATION, "ClusterAdaptFailed", String.format("databaseSet: %s",
defaultDatabaseSet.getName()));
LOGGER.warn("Adapt DefaultDatabaseSet to ClusterDatabaseSet exception", t);
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Connection getConnection(DataSourceIdentity id) throws Exception {
}

@Override
public ClusterConfigProvider getClusterConfigProvider() {
public IntegratedConfigProvider getIntegratedConfigProvider() {
return provider;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public Connection getConnection(DataSourceIdentity id) throws Exception {
}

@Override
public com.ctrip.platform.dal.dao.configure.ClusterConfigProvider getClusterConfigProvider() {
public IntegratedConfigProvider getIntegratedConfigProvider() {
return null;
}

Expand Down

0 comments on commit d822000

Please sign in to comment.