baiyangtx commented on code in PR #3079:
URL: https://github.com/apache/amoro/pull/3079#discussion_r1714575385


##########
amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/table/DefaultTableService.java:
##########
@@ -251,32 +255,94 @@ public Blocker block(
       TableIdentifier tableIdentifier,
       List<BlockableOperation> operations,
       Map<String, String> properties) {
-    checkStarted();
-    return getAndCheckExist(getOrSyncServerTableIdentifier(tableIdentifier))
-        .block(operations, properties, blockerTimeout)
-        .buildBlocker();
+    Preconditions.checkNotNull(operations, "operations should not be null");
+    Preconditions.checkArgument(!operations.isEmpty(), "operations should not 
be empty");
+    Preconditions.checkArgument(blockerTimeout > 0, "blocker timeout must > 
0");
+    String catalog = tableIdentifier.getCatalog();
+    String database = tableIdentifier.getDatabase();
+    String table = tableIdentifier.getTableName();
+    int tryCount = 0;
+    while (tryCount++ < 3) {
+      long now = System.currentTimeMillis();
+      doAs(
+          TableBlockerMapper.class,
+          mapper -> mapper.deleteExpiredBlockers(catalog, database, table, 
now));

Review Comment:
   I think it doesn't matter here. 
   1. TableBlocker is a low-frequency operation. 
   2. There is a TableBlockerExpire thread. Actually, not too much data will be 
deleted in this place. 
   3. There are indexes for catalog, db, and table, and the query efficiency 
won't be too low.



##########
amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/table/DefaultTableService.java:
##########
@@ -251,32 +255,94 @@ public Blocker block(
       TableIdentifier tableIdentifier,
       List<BlockableOperation> operations,
       Map<String, String> properties) {
-    checkStarted();
-    return getAndCheckExist(getOrSyncServerTableIdentifier(tableIdentifier))
-        .block(operations, properties, blockerTimeout)
-        .buildBlocker();
+    Preconditions.checkNotNull(operations, "operations should not be null");
+    Preconditions.checkArgument(!operations.isEmpty(), "operations should not 
be empty");
+    Preconditions.checkArgument(blockerTimeout > 0, "blocker timeout must > 
0");
+    String catalog = tableIdentifier.getCatalog();
+    String database = tableIdentifier.getDatabase();
+    String table = tableIdentifier.getTableName();
+    int tryCount = 0;
+    while (tryCount++ < 3) {

Review Comment:
   fix



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