From 8fe4573e2deff5ded2819f9f8bf7bf6071b17860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=96=87=E9=A2=86?= Date: Thu, 21 Nov 2024 15:50:30 +0800 Subject: [PATCH 1/2] Fix the inconsistency issue between the values of parameters pageNum and pageSize in 'PageHelper#startPage' and the TableMetaMapper#selectTableRuntimesForOptimizerGroup,OptimizingMapper#selectOptimizingProcesses --- .../dashboard/MixedAndIcebergTableDescriptor.java | 4 +--- .../server/persistence/mapper/OptimizingMapper.java | 4 +--- .../server/persistence/mapper/TableMetaMapper.java | 4 +--- .../amoro/server/table/DefaultTableService.java | 7 +------ .../server/optimizing/BaseOptimizingChecker.java | 12 +++--------- 5 files changed, 7 insertions(+), 24 deletions(-) diff --git a/amoro-ams/src/main/java/org/apache/amoro/server/dashboard/MixedAndIcebergTableDescriptor.java b/amoro-ams/src/main/java/org/apache/amoro/server/dashboard/MixedAndIcebergTableDescriptor.java index cc82e4cb76..ac1fb60763 100644 --- a/amoro-ams/src/main/java/org/apache/amoro/server/dashboard/MixedAndIcebergTableDescriptor.java +++ b/amoro-ams/src/main/java/org/apache/amoro/server/dashboard/MixedAndIcebergTableDescriptor.java @@ -524,9 +524,7 @@ public Pair, Integer> getOptimizingProcessesInfo( tableIdentifier.getDatabase(), tableIdentifier.getTableName(), type, - status, - offset, - limit)); + status)); PageInfo pageInfo = new PageInfo<>(processMetaList); total = (int) pageInfo.getTotal(); LOG.info( diff --git a/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/OptimizingMapper.java b/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/OptimizingMapper.java index 4b131407b9..99c5a26451 100644 --- a/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/OptimizingMapper.java +++ b/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/OptimizingMapper.java @@ -130,9 +130,7 @@ List selectOptimizingProcesses( @Param("dbName") String dbName, @Param("tableName") String tableName, @Param("optimizingType") String optimizingType, - @Param("optimizingStatus") ProcessStatus optimizingStatus, - @Param("pageNum") int pageNum, - @Param("pageSize") int pageSize); + @Param("optimizingStatus") ProcessStatus optimizingStatus); /** Optimizing TaskRuntime operation below */ @Insert({ diff --git a/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/TableMetaMapper.java b/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/TableMetaMapper.java index 10e4c2d543..e91d88b98b 100644 --- a/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/TableMetaMapper.java +++ b/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/TableMetaMapper.java @@ -526,7 +526,5 @@ List selectTableRuntimesForOptimizerGroup( @Param("optimizerGroup") String optimizerGroup, @Param("fuzzyDbName") String fuzzyDbName, @Param("fuzzyTableName") String fuzzyTableName, - @Param("statusCodeFilter") List statusCodeFilter, - @Param("pageNum") int pageNum, - @Param("pageSize") int pageSize); + @Param("statusCodeFilter") List statusCodeFilter); } diff --git a/amoro-ams/src/main/java/org/apache/amoro/server/table/DefaultTableService.java b/amoro-ams/src/main/java/org/apache/amoro/server/table/DefaultTableService.java index 71055ceb3e..565cce4e06 100644 --- a/amoro-ams/src/main/java/org/apache/amoro/server/table/DefaultTableService.java +++ b/amoro-ams/src/main/java/org/apache/amoro/server/table/DefaultTableService.java @@ -365,12 +365,7 @@ public Pair, Integer> getTableRuntimes( TableMetaMapper.class, mapper -> mapper.selectTableRuntimesForOptimizerGroup( - optimizerGroup, - fuzzyDbName, - fuzzyTableName, - statusCodeFilters, - limit, - offset)); + optimizerGroup, fuzzyDbName, fuzzyTableName, statusCodeFilters)); PageInfo pageInfo = new PageInfo<>(ret); total = (int) pageInfo.getTotal(); return Pair.of(ret, total); diff --git a/amoro-ams/src/test/java/org/apache/amoro/server/optimizing/BaseOptimizingChecker.java b/amoro-ams/src/test/java/org/apache/amoro/server/optimizing/BaseOptimizingChecker.java index d3d9126350..a38842bf4c 100644 --- a/amoro-ams/src/test/java/org/apache/amoro/server/optimizing/BaseOptimizingChecker.java +++ b/amoro-ams/src/test/java/org/apache/amoro/server/optimizing/BaseOptimizingChecker.java @@ -120,9 +120,7 @@ protected OptimizingProcessMeta waitOptimizeResult() { tableIdentifier.getDatabase(), tableIdentifier.getTableName(), null, - null, - 0, - Integer.MAX_VALUE)); + null)); if (tableOptimizingProcesses == null || tableOptimizingProcesses.isEmpty()) { LOG.info("optimize history is empty"); return Status.RUNNING; @@ -161,9 +159,7 @@ protected OptimizingProcessMeta waitOptimizeResult() { tableIdentifier.getDatabase(), tableIdentifier.getTableName(), null, - null, - 0, - Integer.MAX_VALUE)) + null)) .stream() .filter(p -> p.getProcessId() > lastProcessId) .filter(p -> p.getStatus().equals(ProcessStatus.SUCCESS)) @@ -194,9 +190,7 @@ protected void assertOptimizeHangUp() { tableIdentifier.getDatabase(), tableIdentifier.getTableName(), null, - null, - 0, - Integer.MAX_VALUE)) + null)) .stream() .filter(p -> p.getProcessId() > lastProcessId) .collect(Collectors.toList()); From 54e2e02041e23b1a1e96913b9fd9d16208d94531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=96=87=E9=A2=86?= Date: Thu, 21 Nov 2024 15:50:30 +0800 Subject: [PATCH 2/2] Fix the inconsistency issue between the values of parameters pageNum and pageSize in 'PageHelper#startPage' and the TableMetaMapper#selectTableRuntimesForOptimizerGroup,OptimizingMapper#selectOptimizingProcesses --- .../dashboard/MixedAndIcebergTableDescriptor.java | 4 +--- .../server/persistence/mapper/OptimizingMapper.java | 4 +--- .../server/persistence/mapper/TableMetaMapper.java | 4 +--- .../amoro/server/table/DefaultTableService.java | 7 +------ .../server/optimizing/BaseOptimizingChecker.java | 12 +++--------- 5 files changed, 7 insertions(+), 24 deletions(-) diff --git a/amoro-ams/src/main/java/org/apache/amoro/server/dashboard/MixedAndIcebergTableDescriptor.java b/amoro-ams/src/main/java/org/apache/amoro/server/dashboard/MixedAndIcebergTableDescriptor.java index cc82e4cb76..ac1fb60763 100644 --- a/amoro-ams/src/main/java/org/apache/amoro/server/dashboard/MixedAndIcebergTableDescriptor.java +++ b/amoro-ams/src/main/java/org/apache/amoro/server/dashboard/MixedAndIcebergTableDescriptor.java @@ -524,9 +524,7 @@ public Pair, Integer> getOptimizingProcessesInfo( tableIdentifier.getDatabase(), tableIdentifier.getTableName(), type, - status, - offset, - limit)); + status)); PageInfo pageInfo = new PageInfo<>(processMetaList); total = (int) pageInfo.getTotal(); LOG.info( diff --git a/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/OptimizingMapper.java b/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/OptimizingMapper.java index 4b131407b9..99c5a26451 100644 --- a/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/OptimizingMapper.java +++ b/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/OptimizingMapper.java @@ -130,9 +130,7 @@ List selectOptimizingProcesses( @Param("dbName") String dbName, @Param("tableName") String tableName, @Param("optimizingType") String optimizingType, - @Param("optimizingStatus") ProcessStatus optimizingStatus, - @Param("pageNum") int pageNum, - @Param("pageSize") int pageSize); + @Param("optimizingStatus") ProcessStatus optimizingStatus); /** Optimizing TaskRuntime operation below */ @Insert({ diff --git a/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/TableMetaMapper.java b/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/TableMetaMapper.java index 10e4c2d543..e91d88b98b 100644 --- a/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/TableMetaMapper.java +++ b/amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/TableMetaMapper.java @@ -526,7 +526,5 @@ List selectTableRuntimesForOptimizerGroup( @Param("optimizerGroup") String optimizerGroup, @Param("fuzzyDbName") String fuzzyDbName, @Param("fuzzyTableName") String fuzzyTableName, - @Param("statusCodeFilter") List statusCodeFilter, - @Param("pageNum") int pageNum, - @Param("pageSize") int pageSize); + @Param("statusCodeFilter") List statusCodeFilter); } diff --git a/amoro-ams/src/main/java/org/apache/amoro/server/table/DefaultTableService.java b/amoro-ams/src/main/java/org/apache/amoro/server/table/DefaultTableService.java index 71055ceb3e..565cce4e06 100644 --- a/amoro-ams/src/main/java/org/apache/amoro/server/table/DefaultTableService.java +++ b/amoro-ams/src/main/java/org/apache/amoro/server/table/DefaultTableService.java @@ -365,12 +365,7 @@ public Pair, Integer> getTableRuntimes( TableMetaMapper.class, mapper -> mapper.selectTableRuntimesForOptimizerGroup( - optimizerGroup, - fuzzyDbName, - fuzzyTableName, - statusCodeFilters, - limit, - offset)); + optimizerGroup, fuzzyDbName, fuzzyTableName, statusCodeFilters)); PageInfo pageInfo = new PageInfo<>(ret); total = (int) pageInfo.getTotal(); return Pair.of(ret, total); diff --git a/amoro-ams/src/test/java/org/apache/amoro/server/optimizing/BaseOptimizingChecker.java b/amoro-ams/src/test/java/org/apache/amoro/server/optimizing/BaseOptimizingChecker.java index d3d9126350..a38842bf4c 100644 --- a/amoro-ams/src/test/java/org/apache/amoro/server/optimizing/BaseOptimizingChecker.java +++ b/amoro-ams/src/test/java/org/apache/amoro/server/optimizing/BaseOptimizingChecker.java @@ -120,9 +120,7 @@ protected OptimizingProcessMeta waitOptimizeResult() { tableIdentifier.getDatabase(), tableIdentifier.getTableName(), null, - null, - 0, - Integer.MAX_VALUE)); + null)); if (tableOptimizingProcesses == null || tableOptimizingProcesses.isEmpty()) { LOG.info("optimize history is empty"); return Status.RUNNING; @@ -161,9 +159,7 @@ protected OptimizingProcessMeta waitOptimizeResult() { tableIdentifier.getDatabase(), tableIdentifier.getTableName(), null, - null, - 0, - Integer.MAX_VALUE)) + null)) .stream() .filter(p -> p.getProcessId() > lastProcessId) .filter(p -> p.getStatus().equals(ProcessStatus.SUCCESS)) @@ -194,9 +190,7 @@ protected void assertOptimizeHangUp() { tableIdentifier.getDatabase(), tableIdentifier.getTableName(), null, - null, - 0, - Integer.MAX_VALUE)) + null)) .stream() .filter(p -> p.getProcessId() > lastProcessId) .collect(Collectors.toList());