slfan1989 commented on code in PR #13795:
URL: https://github.com/apache/iceberg/pull/13795#discussion_r2272072486


##########
flink/v2.0/flink/src/test/java/org/apache/iceberg/flink/maintenance/api/TestZkLockFactory.java:
##########
@@ -39,15 +48,32 @@ void before() {
     super.before();
   }
 
-  @Override
-  TriggerLockFactory lockFactory() {
-    return new ZkLockFactory(zkTestServer.getConnectString(), testLockId, 
5000, 3000, 1000, 3);
+  @Test
+  void testMultiTableLock() throws IOException {
+    // Create two lock factories for different tables
+    ZkLockFactory other = lockFactory("tableName2");
+    other.open();
+    TriggerLockFactory.Lock lock1 = lockFactory.createLock();
+    TriggerLockFactory.Lock lock2 = other.createLock();
+
+    // Verify that locks for different tables can be acquired independently
+    assertThat(lock1.tryLock()).isTrue();
+    assertThat(lock2.tryLock()).isTrue();
+
+    // Clean up
+    lock1.unlock();
+    lock2.unlock();
+    other.close();
   }
 
-  @After
+  ZkLockFactory lockFactory(String tableName) {
+    String lockId = "test_job_" + tableName + "_" + 
UUID.randomUUID().toString().replace("-", "");

Review Comment:
   Thank you for your review! I have optimized this part of the code based on 
your suggestions.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to