Skip to content

Commit

Permalink
refactor: rename fs to file provider
Browse files Browse the repository at this point in the history
  • Loading branch information
ethe committed Jul 17, 2024
1 parent a7e9d07 commit 1e1b6b3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/executor.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::future::Future;

use crate::fs::Fs;
use crate::fs::FileProvider;

pub trait Executor: Fs {
pub trait Executor: FileProvider {
fn spawn<F>(&self, future: F)
where
F: Future<Output = ()> + Send + 'static;
Expand Down
2 changes: 1 addition & 1 deletion src/fs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub trait AsyncFile: AsyncRead + AsyncWrite + AsyncSeek + Send + Sync + Unpin +

impl<T> AsyncFile for T where T: AsyncRead + AsyncWrite + AsyncSeek + Send + Sync + Unpin + 'static {}

pub trait Fs {
pub trait FileProvider {
type File: AsyncFile;

fn open(path: impl AsRef<Path>) -> impl Future<Output = io::Result<Self::File>>;
Expand Down
4 changes: 2 additions & 2 deletions src/fs/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ use std::{io, path::Path};
use tokio::fs::{remove_file, File};
use tokio_util::compat::{Compat, TokioAsyncReadCompatExt};

use super::Fs;
use super::FileProvider;
use crate::executor::tokio::TokioExecutor;

impl Fs for TokioExecutor {
impl FileProvider for TokioExecutor {
type File = Compat<File>;

async fn open(path: impl AsRef<Path>) -> io::Result<Self::File> {
Expand Down
2 changes: 1 addition & 1 deletion src/ondisk/sstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ mod tests {
use super::SsTable;
use crate::{
executor::tokio::TokioExecutor,
fs::{AsyncFile, Fs},
fs::{AsyncFile, FileProvider},
oracle::timestamp::Timestamped,
tests::{get_test_record_batch, Test},
};
Expand Down

0 comments on commit 1e1b6b3

Please sign in to comment.