Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix name DtraceLayerWrapper #4165

Merged
merged 1 commit into from
Feb 7, 2024
Merged
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
28 changes: 14 additions & 14 deletions core/src/layers/dtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ impl<A: Accessor> Debug for DTraceAccessor<A> {
#[async_trait]
impl<A: Accessor> LayeredAccessor for DTraceAccessor<A> {
type Inner = A;
type Reader = DtraceLayerWarpper<A::Reader>;
type BlockingReader = DtraceLayerWarpper<A::BlockingReader>;
type Writer = DtraceLayerWarpper<A::Writer>;
type BlockingWriter = DtraceLayerWarpper<A::BlockingWriter>;
type Reader = DtraceLayerWrapper<A::Reader>;
type BlockingReader = DtraceLayerWrapper<A::BlockingReader>;
type Writer = DtraceLayerWrapper<A::Writer>;
type BlockingWriter = DtraceLayerWrapper<A::BlockingWriter>;
type Lister = A::Lister;
type BlockingLister = A::BlockingLister;

Expand All @@ -220,7 +220,7 @@ impl<A: Accessor> LayeredAccessor for DTraceAccessor<A> {
.inner
.read(path, args)
.await
.map(|(rp, r)| (rp, DtraceLayerWarpper::new(r, &path.to_string())));
.map(|(rp, r)| (rp, DtraceLayerWrapper::new(r, &path.to_string())));
probe_lazy!(opendal, read_end, c_path.as_ptr());
result
}
Expand All @@ -232,7 +232,7 @@ impl<A: Accessor> LayeredAccessor for DTraceAccessor<A> {
.inner
.write(path, args)
.await
.map(|(rp, r)| (rp, DtraceLayerWarpper::new(r, &path.to_string())));
.map(|(rp, r)| (rp, DtraceLayerWrapper::new(r, &path.to_string())));

probe_lazy!(opendal, write_end, c_path.as_ptr());
result
Expand Down Expand Up @@ -288,7 +288,7 @@ impl<A: Accessor> LayeredAccessor for DTraceAccessor<A> {
let result = self
.inner
.blocking_read(path, args)
.map(|(rp, r)| (rp, DtraceLayerWarpper::new(r, &path.to_string())));
.map(|(rp, r)| (rp, DtraceLayerWrapper::new(r, &path.to_string())));
probe_lazy!(opendal, blocking_read_end, c_path.as_ptr());
result
}
Expand All @@ -299,7 +299,7 @@ impl<A: Accessor> LayeredAccessor for DTraceAccessor<A> {
let result = self
.inner
.blocking_write(path, args)
.map(|(rp, r)| (rp, DtraceLayerWarpper::new(r, &path.to_string())));
.map(|(rp, r)| (rp, DtraceLayerWrapper::new(r, &path.to_string())));
probe_lazy!(opendal, blocking_write_end, c_path.as_ptr());
result
}
Expand Down Expand Up @@ -329,12 +329,12 @@ impl<A: Accessor> LayeredAccessor for DTraceAccessor<A> {
}
}

pub struct DtraceLayerWarpper<R> {
pub struct DtraceLayerWrapper<R> {
inner: R,
path: String,
}

impl<R> DtraceLayerWarpper<R> {
impl<R> DtraceLayerWrapper<R> {
pub fn new(inner: R, path: &String) -> Self {
Self {
inner,
Expand All @@ -343,7 +343,7 @@ impl<R> DtraceLayerWarpper<R> {
}
}

impl<R: oio::Read> oio::Read for DtraceLayerWarpper<R> {
impl<R: oio::Read> oio::Read for DtraceLayerWrapper<R> {
fn poll_read(&mut self, cx: &mut Context<'_>, buf: &mut [u8]) -> Poll<Result<usize>> {
let c_path = CString::new(self.path.clone()).unwrap();
probe_lazy!(opendal, reader_read_start, c_path.as_ptr());
Expand Down Expand Up @@ -393,7 +393,7 @@ impl<R: oio::Read> oio::Read for DtraceLayerWarpper<R> {
}
}

impl<R: oio::BlockingRead> oio::BlockingRead for DtraceLayerWarpper<R> {
impl<R: oio::BlockingRead> oio::BlockingRead for DtraceLayerWrapper<R> {
fn read(&mut self, buf: &mut [u8]) -> Result<usize> {
let c_path = CString::new(self.path.clone()).unwrap();
probe_lazy!(opendal, blocking_reader_read_start, c_path.as_ptr());
Expand Down Expand Up @@ -445,7 +445,7 @@ impl<R: oio::BlockingRead> oio::BlockingRead for DtraceLayerWarpper<R> {
}
}

impl<R: oio::Write> oio::Write for DtraceLayerWarpper<R> {
impl<R: oio::Write> oio::Write for DtraceLayerWrapper<R> {
fn poll_write(&mut self, cx: &mut Context<'_>, bs: &dyn oio::WriteBuf) -> Poll<Result<usize>> {
let c_path = CString::new(self.path.clone()).unwrap();
probe_lazy!(opendal, writer_write_start, c_path.as_ptr());
Expand Down Expand Up @@ -490,7 +490,7 @@ impl<R: oio::Write> oio::Write for DtraceLayerWarpper<R> {
}
}

impl<R: oio::BlockingWrite> oio::BlockingWrite for DtraceLayerWarpper<R> {
impl<R: oio::BlockingWrite> oio::BlockingWrite for DtraceLayerWrapper<R> {
fn write(&mut self, bs: &dyn oio::WriteBuf) -> Result<usize> {
let c_path = CString::new(self.path.clone()).unwrap();
probe_lazy!(opendal, blocking_writer_write_start, c_path.as_ptr());
Expand Down
Loading