From 2deacb4e9c99fd071f9b33b6285c8c95b2faa31a Mon Sep 17 00:00:00 2001 From: An Qi Date: Thu, 18 Apr 2024 14:41:54 +0800 Subject: [PATCH] fix --- .../iginx/filesystem/exec/FileSystemManager.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/dataSources/filesystem/src/main/java/cn/edu/tsinghua/iginx/filesystem/exec/FileSystemManager.java b/dataSources/filesystem/src/main/java/cn/edu/tsinghua/iginx/filesystem/exec/FileSystemManager.java index 0e1394edde..529efcd087 100644 --- a/dataSources/filesystem/src/main/java/cn/edu/tsinghua/iginx/filesystem/exec/FileSystemManager.java +++ b/dataSources/filesystem/src/main/java/cn/edu/tsinghua/iginx/filesystem/exec/FileSystemManager.java @@ -56,8 +56,6 @@ public FileSystemManager(Map params) { public List readFile( File file, TagFilter tagFilter, List keyRanges, boolean isDummy) throws IOException { - file = FilePathUtils.normalize(file, FileAccessType.READ); - List res = new ArrayList<>(); // 首先通过tagFilter和file,找到所有有关的文件列表 List files = getFilesWithTagFilter(file, tagFilter, isDummy); @@ -288,11 +286,6 @@ public void deleteFile(File file) throws IOException { * @return 如果删除操作失败则抛出异常 */ public void deleteFiles(List files, TagFilter filter) throws IOException { - files = - files.stream() - .map(f -> FilePathUtils.normalize(f, FileAccessType.WRITE)) - .collect(Collectors.toList()); - for (File file : files) { try { for (File f : getFilesWithTagFilter(file, filter, false)) { @@ -313,10 +306,6 @@ public void trimFilesContent(List files, TagFilter tagFilter, long startKe LOGGER.warn("cant trim the file that not exist!"); continue; } - fileList = - fileList.stream() - .map(f -> FilePathUtils.normalize(f, FileAccessType.WRITE)) - .collect(Collectors.toList()); for (File f : fileList) { fileOperator.trimFile(f, startKey, endKey); } @@ -376,7 +365,9 @@ public FileVisitResult postVisitDirectory(Path dir, IOException exc) { throw new IOException( String.format("get associated files of %s failure: %s", file.getAbsolutePath(), e)); } - return associatedFiles; + return associatedFiles.stream() + .map(f -> FilePathUtils.normalize(f, FileAccessType.WRITE)) + .collect(Collectors.toList()); } public List getAllFiles(File dir, boolean containsEmptyDir) {