Skip to content

Commit

Permalink
[AMORO-3253] Optijmizing getOPtimizingProcessTasks and getOptimizingT…
Browse files Browse the repository at this point in the history
…ypes 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.
  • Loading branch information
klion26 authored Oct 15, 2024
1 parent d1274a9 commit 39a5aa1
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> values =
tableDescriptor.getTableOptimizingTypes(tableIdentifier.buildTableIdentifier());
Expand All @@ -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<OptimizingTaskInfo> optimizingTaskInfos =
Expand Down

0 comments on commit 39a5aa1

Please sign in to comment.