From 57cf5f0a4ef5f1c82cd13ee330eaf3dbc2e11d30 Mon Sep 17 00:00:00 2001 From: Loki Date: Sat, 21 Mar 2026 15:25:35 +0800 Subject: [PATCH 1/3] fix: fix loadfile limit --- .../hugegraph/controller/load/FileUploadController.java | 4 ++-- .../apache/hugegraph/service/load/FileMappingService.java | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/FileUploadController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/FileUploadController.java index ea29b74d1..b4f25a84b 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/FileUploadController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/FileUploadController.java @@ -277,12 +277,12 @@ private void checkFileValid(int connId, int jobId, JobManager jobEntity, long totalFileSizeLimit = this.config.get( HubbleOptions.UPLOAD_TOTAL_FILE_SIZE_LIMIT); - List fileMappings = this.service.listAll(); + List fileMappings = this.service.listByConnId(connId); long currentTotalSize = fileMappings.stream() .map(FileMapping::getTotalSize) .reduce(0L, (Long::sum)); Ex.check(fileSize + currentTotalSize <= totalFileSizeLimit, - "load.upload.file.exceed-single-size", + "load.upload.file.exceed-total-size", FileUtils.byteCountToDisplaySize(totalFileSizeLimit)); } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/FileMappingService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/FileMappingService.java index e574ad797..c3a7fb6b0 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/FileMappingService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/FileMappingService.java @@ -105,6 +105,12 @@ public List listAll() { return this.mapper.selectList(null); } + public List listByConnId(int connId) { + QueryWrapper query = Wrappers.query(); + query.eq("conn_id", connId); + return this.mapper.selectList(query); + } + public IPage list(int connId, int jobId, int pageNo, int pageSize) { QueryWrapper query = Wrappers.query(); query.eq("conn_id", connId); From d3a3a46b1dc674db7febc328bec3ae3e52ac253f Mon Sep 17 00:00:00 2001 From: Loki Date: Sun, 22 Mar 2026 19:34:30 +0800 Subject: [PATCH 2/3] optimize: use jobEntity.getJobSize() --- .../hugegraph/controller/load/FileUploadController.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/FileUploadController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/FileUploadController.java index b4f25a84b..b37dcc6e0 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/FileUploadController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/FileUploadController.java @@ -277,10 +277,7 @@ private void checkFileValid(int connId, int jobId, JobManager jobEntity, long totalFileSizeLimit = this.config.get( HubbleOptions.UPLOAD_TOTAL_FILE_SIZE_LIMIT); - List fileMappings = this.service.listByConnId(connId); - long currentTotalSize = fileMappings.stream() - .map(FileMapping::getTotalSize) - .reduce(0L, (Long::sum)); + long currentTotalSize = jobEntity.getJobSize(); Ex.check(fileSize + currentTotalSize <= totalFileSizeLimit, "load.upload.file.exceed-total-size", FileUtils.byteCountToDisplaySize(totalFileSizeLimit)); From 2aee07b57b47a46277df68712258dd4d53a3bd63 Mon Sep 17 00:00:00 2001 From: Loki Date: Sun, 22 Mar 2026 22:18:29 +0800 Subject: [PATCH 3/3] optimize: remove the unuse code --- .../apache/hugegraph/service/load/FileMappingService.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/FileMappingService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/FileMappingService.java index c3a7fb6b0..e574ad797 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/FileMappingService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/FileMappingService.java @@ -105,12 +105,6 @@ public List listAll() { return this.mapper.selectList(null); } - public List listByConnId(int connId) { - QueryWrapper query = Wrappers.query(); - query.eq("conn_id", connId); - return this.mapper.selectList(query); - } - public IPage list(int connId, int jobId, int pageNo, int pageSize) { QueryWrapper query = Wrappers.query(); query.eq("conn_id", connId);