wizhuo commented on code in PR #2184:
URL: 
https://github.com/apache/shardingsphere-elasticjob/pull/2184#discussion_r1115708932


##########
elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java:
##########
@@ -61,14 +63,41 @@ public final class RDBJobEventStorage {
     private final DatabaseType databaseType;
     
     private final RDBStorageSQLMapper sqlMapper;
+
+    private static final Map<DataSource, RDBJobEventStorage> STORAGE_MAP = new 
ConcurrentHashMap<>();
+
     
     static {
         for (DatabaseType each : ServiceLoader.load(DatabaseType.class)) {
             DATABASE_TYPES.put(each.getType(), each);
         }
     }
+
+    public static RDBJobEventStorage getInstance(final DataSource dataSource) 
throws SQLException {
+        return wrapException(() -> STORAGE_MAP.computeIfAbsent(dataSource, 
(ds) -> {
+            try {
+                return new RDBJobEventStorage(ds);
+            } catch (SQLException e) {
+                throw new RuntimeException(e);
+            }
+        }));
+    }
+
+    public static RDBJobEventStorage 
wrapException(Callable<RDBJobEventStorage> callable) throws SQLException {

Review Comment:
   
![image](https://user-images.githubusercontent.com/46399833/220915814-6d22d016-c86d-4eef-83fc-1af8c8749eb3.png)
   
https://github.com/apache/shardingsphere-elasticjob/actions/runs/4248881615/jobs/7388688271
    
   The above link is the information about the failure of the last build. From 
the error information, we can see that zookeeper was closed for some reason, 
which caused the unit test to fail. I tried executing the command locally with 
success: 
   
   ```
   ./mvnw --batch-mode --no-transfer-progress '-Dmaven.javadoc.skip=true' clean 
install
   ```
   I  can not reproduce the above error, what do you suggest?
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to