This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new ee466bcac1 [core] CleanOrphanFilesResult.deletedFilesPath should be
nullable
ee466bcac1 is described below
commit ee466bcac14bd7f1229beeaf4e405da0956792ca
Author: Jingsong <[email protected]>
AuthorDate: Tue Nov 26 13:07:43 2024 +0800
[core] CleanOrphanFilesResult.deletedFilesPath should be nullable
---
.../apache/paimon/operation/CleanOrphanFilesResult.java | 16 +++++++++++-----
.../apache/paimon/operation/LocalOrphanFilesClean.java | 4 ++--
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git
a/paimon-core/src/main/java/org/apache/paimon/operation/CleanOrphanFilesResult.java
b/paimon-core/src/main/java/org/apache/paimon/operation/CleanOrphanFilesResult.java
index 5a3bc67f9c..d29eede720 100644
---
a/paimon-core/src/main/java/org/apache/paimon/operation/CleanOrphanFilesResult.java
+++
b/paimon-core/src/main/java/org/apache/paimon/operation/CleanOrphanFilesResult.java
@@ -20,24 +20,29 @@ package org.apache.paimon.operation;
import org.apache.paimon.fs.Path;
+import javax.annotation.Nullable;
+
import java.util.List;
/** The result of OrphanFilesClean. */
public class CleanOrphanFilesResult {
- private List<Path> deletedFilesPath;
private final long deletedFileCount;
private final long deletedFileTotalLenInBytes;
+ @Nullable private final List<Path> deletedFilesPath;
+
public CleanOrphanFilesResult(long deletedFileCount, long
deletedFileTotalLenInBytes) {
- this.deletedFileCount = deletedFileCount;
- this.deletedFileTotalLenInBytes = deletedFileTotalLenInBytes;
+ this(deletedFileCount, deletedFileTotalLenInBytes, null);
}
public CleanOrphanFilesResult(
- List<Path> deletedFilesPath, long deletedFileCount, long
deletedFileTotalLenInBytes) {
- this(deletedFileCount, deletedFileTotalLenInBytes);
+ long deletedFileCount,
+ long deletedFileTotalLenInBytes,
+ @Nullable List<Path> deletedFilesPath) {
this.deletedFilesPath = deletedFilesPath;
+ this.deletedFileCount = deletedFileCount;
+ this.deletedFileTotalLenInBytes = deletedFileTotalLenInBytes;
}
public long getDeletedFileCount() {
@@ -48,6 +53,7 @@ public class CleanOrphanFilesResult {
return deletedFileTotalLenInBytes;
}
+ @Nullable
public List<Path> getDeletedFilesPath() {
return deletedFilesPath;
}
diff --git
a/paimon-core/src/main/java/org/apache/paimon/operation/LocalOrphanFilesClean.java
b/paimon-core/src/main/java/org/apache/paimon/operation/LocalOrphanFilesClean.java
index 511c5fc7fb..6a42766624 100644
---
a/paimon-core/src/main/java/org/apache/paimon/operation/LocalOrphanFilesClean.java
+++
b/paimon-core/src/main/java/org/apache/paimon/operation/LocalOrphanFilesClean.java
@@ -101,7 +101,7 @@ public class LocalOrphanFilesClean extends OrphanFilesClean
{
Map<String, Pair<Path, Long>> candidates = getCandidateDeletingFiles();
if (candidates.isEmpty()) {
return new CleanOrphanFilesResult(
- deleteFiles, deleteFiles.size(),
deletedFilesLenInBytes.get());
+ deleteFiles.size(), deletedFilesLenInBytes.get(),
deleteFiles);
}
candidateDeletes = new HashSet<>(candidates.keySet());
@@ -128,7 +128,7 @@ public class LocalOrphanFilesClean extends OrphanFilesClean
{
candidateDeletes.clear();
return new CleanOrphanFilesResult(
- deleteFiles, deleteFiles.size(), deletedFilesLenInBytes.get());
+ deleteFiles.size(), deletedFilesLenInBytes.get(), deleteFiles);
}
private void collectWithoutDataFile(