CalvinKirs commented on code in PR #2708:
URL: 
https://github.com/apache/incubator-seatunnel/pull/2708#discussion_r970278440


##########
seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveMetaStoreProxy.java:
##########
@@ -38,15 +46,36 @@ public HiveMetaStoreProxy(@NonNull String uris) {
         }
     }
 
+    public static synchronized HiveMetaStoreProxy getInstance(Config config) {
+        if (INSTANCE == null) {
+            String metastoreUri = config.getString(HiveConfig.METASTORE_URI);
+            INSTANCE = new HiveMetaStoreProxy(metastoreUri);
+        }
+        return INSTANCE;
+    }

Review Comment:
   We can lock during initialization, 
   ```
   if instance! =null 
      then return,
      else lock and init
   ```



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