Skip to content

Commit

Permalink
Use Velox filesystem in SSD Cache
Browse files Browse the repository at this point in the history
  • Loading branch information
zacw7 committed Jul 17, 2024
1 parent 5eac2f4 commit c7f734e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions velox/common/caching/SsdFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ SsdFile::SsdFile(const Config& config)
if (disableFileCow_) {
disableCow(fd_);
}
auto fs = filesystems::getFileSystem(path_, nullptr);

writeFile_ = std::make_unique<LocalWriteFile>(fd_)
readFile_ = std::make_unique<LocalReadFile>(fd_);
const uint64_t size = lseek(fd_, 0, SEEK_END);
numRegions_ = std::min<int32_t>(size / kRegionSize, maxRegions_);
Expand Down
5 changes: 4 additions & 1 deletion velox/common/caching/SsdFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -552,14 +552,17 @@ class SsdFile {
folly::F14FastMap<FileCacheKey, SsdRun> entries_;

// File descriptor. 0 (stdin) means file not open.
int32_t fd_{0};
// int32_t fd_{0};

// Size of the backing file in bytes. Must be multiple of kRegionSize.
uint64_t fileSize_{0};

// ReadFile made from 'fd_'.
std::unique_ptr<ReadFile> readFile_;

// WriteFile made from 'fd_'.
std::unique_ptr<WriteFile> writeFile_;

// Counters.
SsdCacheStats stats_;

Expand Down

0 comments on commit c7f734e

Please sign in to comment.