Enhance RandomDataSourceSelector

1. shorten the checking interval when validate failed
2. provide some parameters in higher level
3. add a sleep before validation (default 0)
4. validate the DataSource concurrently
This commit is contained in:
DigitalSonic
2019-02-01 18:21:16 +08:00
parent 65fafdb67a
commit b6c90db170
6 changed files with 147 additions and 27 deletions
@@ -105,6 +105,7 @@ public class HighAvailableDataSource extends WrapperAdapter implements DataSourc
}
if (selector == null) {
selector = new RandomDataSourceSelector(this);
selector.init();
}
if (dataSourceMap == null || dataSourceMap.isEmpty()) {
LOG.warn("There is NO DataSource available!!! Please check your configuration.");