Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/paimon/common/executor/future.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ namespace paimon {
/// execution.
///
/// @note If `func` returns `void`, the returned future is of type `std::future<void>`.
///
/// TODO: Since paimon-cpp uses `Status`/`Result` for error handling throughout, the exception
/// capture logic (try/catch + set_exception) in `Via()` will be removed in the future.
template <typename Func>
auto Via(Executor* executor, Func&& func) -> std::future<decltype(func())> {
using ResultType = decltype(func());
Expand Down
3 changes: 3 additions & 0 deletions src/paimon/core/operation/orphan_files_cleaner_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,14 @@ Result<std::set<std::string>> OrphanFilesCleanerImpl::Clean() {
}
PAIMON_ASSIGN_OR_RAISE(std::set<std::string> all_dirs, ListPaimonFileDirs());
std::vector<std::future<std::vector<std::unique_ptr<FileStatus>>>> file_statuses_futures;
ScopeGuard file_statuses_guard(
[&file_statuses_futures]() { CollectAll(file_statuses_futures); });
for (const auto& dir : all_dirs) {
file_statuses_futures.push_back(
Via(executor_.get(), [this, dir] { return TryBestListingDirs(dir); }));
Comment thread
zjw1111 marked this conversation as resolved.
}
PAIMON_ASSIGN_OR_RAISE(std::set<std::string> used_file_names, GetUsedFiles());
file_statuses_guard.Release();

Duration duration;
std::set<std::string> need_to_deletes;
Expand Down
Loading