yuqi1129 commented on code in PR #11364:
URL: https://github.com/apache/gravitino/pull/11364#discussion_r3345507980
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/dispatcher/IcebergTableOperationExecutor.java:
##########
@@ -110,15 +121,38 @@ public LoadTableResponse updateTable(
@Override
public void dropTable(
IcebergRequestContext context, TableIdentifier tableIdentifier, boolean
purgeRequested) {
- if (purgeRequested) {
- icebergCatalogWrapperManager
- .getCatalogWrapper(context.catalogName())
- .purgeTable(tableIdentifier);
- } else {
- icebergCatalogWrapperManager
- .getCatalogWrapper(context.catalogName())
- .dropTable(tableIdentifier);
+ IcebergCatalogWrapper wrapper =
+ icebergCatalogWrapperManager.getCatalogWrapper(context.catalogName());
+ if (!purgeRequested) {
+ wrapper.dropTable(tableIdentifier);
+ return;
+ }
+
+ // Async cleanup is opt-in per request and only wired in auxiliary mode;
otherwise purge inline.
+ if (!context.asyncPurge()) {
+ wrapper.purgeTable(tableIdentifier);
+ return;
}
+
+ cleanupManager.ifPresentOrElse(
Review Comment:
If the code goes here, it means it will use the async mode, so what if
`cleanupManager` is empty? According to your code, will you use the sync mode
instead?
--
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]