From 39a5aa1823e68dd3cbb5b55c74c2882f86de7534 Mon Sep 17 00:00:00 2001 From: Congxian Qiu Date: Tue, 15 Oct 2024 11:55:29 +0800 Subject: [PATCH] [AMORO-3253] Optijmizing getOPtimizingProcessTasks and getOptimizingTypes rest efficiency (#3254) Before the change we'll check whether the table exists by loading the table, the loading step maybe too expensive, and it's redundant because the table exists will be checked in the folllowing step when loading table to retrieve the info. --- .../amoro/server/dashboard/controller/TableController.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/amoro-ams/src/main/java/org/apache/amoro/server/dashboard/controller/TableController.java b/amoro-ams/src/main/java/org/apache/amoro/server/dashboard/controller/TableController.java index 1fd1f596fa..9db6f074df 100644 --- a/amoro-ams/src/main/java/org/apache/amoro/server/dashboard/controller/TableController.java +++ b/amoro-ams/src/main/java/org/apache/amoro/server/dashboard/controller/TableController.java @@ -338,8 +338,6 @@ public void getOptimizingTypes(Context ctx) { String db = ctx.pathParam("db"); String table = ctx.pathParam("table"); TableIdentifier tableIdentifier = TableIdentifier.of(catalog, db, table); - ServerCatalog serverCatalog = tableService.getServerCatalog(catalog); - Preconditions.checkState(serverCatalog.tableExists(db, table), "no such table"); Map values = tableDescriptor.getTableOptimizingTypes(tableIdentifier.buildTableIdentifier()); @@ -361,10 +359,8 @@ public void getOptimizingProcessTasks(Context ctx) { int offset = (page - 1) * pageSize; int limit = pageSize; - ServerCatalog serverCatalog = tableService.getServerCatalog(catalog); Preconditions.checkArgument(offset >= 0, "offset[%s] must >= 0", offset); Preconditions.checkArgument(limit >= 0, "limit[%s] must >= 0", limit); - Preconditions.checkState(serverCatalog.tableExists(db, table), "no such table"); TableIdentifier tableIdentifier = TableIdentifier.of(catalog, db, table); List optimizingTaskInfos =