Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aqni committed Apr 18, 2024
1 parent 2c02235 commit 2deacb4
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ public FileSystemManager(Map<String, String> params) {
public List<FileSystemResultTable> readFile(
File file, TagFilter tagFilter, List<KeyRange> keyRanges, boolean isDummy)
throws IOException {
file = FilePathUtils.normalize(file, FileAccessType.READ);

List<FileSystemResultTable> res = new ArrayList<>();
// 首先通过tagFilter和file,找到所有有关的文件列表
List<File> files = getFilesWithTagFilter(file, tagFilter, isDummy);
Expand Down Expand Up @@ -288,11 +286,6 @@ public void deleteFile(File file) throws IOException {
* @return 如果删除操作失败则抛出异常
*/
public void deleteFiles(List<File> 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)) {
Expand All @@ -313,10 +306,6 @@ public void trimFilesContent(List<File> 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);
}
Expand Down Expand Up @@ -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<File> getAllFiles(File dir, boolean containsEmptyDir) {
Expand Down

0 comments on commit 2deacb4

Please sign in to comment.