Conversation
Signed-off-by: Alex Snaps <alex@wcgw.dev>
Signed-off-by: Alex Snaps <alex@wcgw.dev>
Signed-off-by: Alex Snaps <alex@wcgw.dev>
Signed-off-by: Alex Snaps <alex@wcgw.dev>
Signed-off-by: Alex Snaps <alex@wcgw.dev>
Signed-off-by: Alex Snaps <alex@wcgw.dev>
Signed-off-by: Alex Snaps <alex@wcgw.dev>
Signed-off-by: Alex Snaps <alex@wcgw.dev>
Signed-off-by: Alex Snaps <alex@wcgw.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Env Abstraction — Implementation Log
Pluggable filesystem backend replacing hardcoded
std::fs/libcI/O.Steps
PosixFileSystem— Createsrc/env.rswithSequentialFile,RandomAccessFile,WritableFile,FileLock,FileSystemtraits andPosixFileSystemimplementation. AddOptions::file_system: Arc<dyn FileSystem>defaulting toPosixFileSystem. No existing code changes beyond the new file and options field.LogWriterandLogReader— ChangeLogWriterto wrapBox<dyn WritableFile>(instead ofBufWriter<File>) andLogReaderto wrapBox<dyn SequentialFile>(instead ofFile). Update all callers(WAL creation, MANIFEST creation, WAL replay, repair).
Tablereader — ChangeTable::opento takeArc<dyn RandomAccessFile>instead ofFile.read_blockand footer reads go through the trait.TablestoresArc<dyn RandomAccessFile>.TableBuilder— Change constructor to takeBox<dyn WritableFile>instead ofFile.TableCache—get_or_opencallsfs.open_random_access(path)instead ofFile::open.TableCachestoresArc<dyn FileSystem>.VersionSet— MANIFEST creation/reading and CURRENT file read/write go throughFileSystem.VersionSet::createandVersionSet::recovertake or store the filesystem handle.lib.rs+ stopgap cleanup — Replace all remainingstd::fscalls (~30 sites) inDb::open,begin_flush,write_flush,finish_flush,do_compaction,delete_obsolete_files,Db::destroy,Db::repair, andacquire_lock.PersistencestoresArc<dyn FileSystem>.libc::flockmoves intoPosixFileSystem::lock_file. Also replace all stopgapPosixFileSystem/writable_from_file/random_access_from_file/sequential_from_filecalls in production code (marked withTODO) withOptions::file_system— threading theArc<dyn FileSystem>fromOptionsthroughPersistence,TableCache,VersionSet, and all free functions that create files. Test code may remain hardcoded to POSIX.libcusage fromlib.rs. Verifylibcis only used insidePosixFileSystem. Run full test suite.