Skip to content

Commit

Permalink
fix clippy unused issue for now
Browse files Browse the repository at this point in the history
  • Loading branch information
shbhmrzd committed Jan 16, 2024
1 parent 8b9d12a commit 6171833
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 29 deletions.
34 changes: 17 additions & 17 deletions core/src/services/hdfs_native/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,25 +145,25 @@ impl Builder for HdfsNativeBuilder {
Ok(HdfsNativeBackend {
root,
client: Arc::new(client),
enable_append: self.config.enable_append,
_enable_append: self.config.enable_append,
})
}
}

#[inline]
fn tmp_file_of(path: &str) -> String {
let name = get_basename(path);
let uuid = Uuid::new_v4().to_string();

format!("{name}.{uuid}")
}
// #[inline]
// fn tmp_file_of(path: &str) -> String {
// let name = get_basename(path);
// let uuid = Uuid::new_v4().to_string();
//
// format!("{name}.{uuid}")
// }

/// Backend for hdfs-native services.
#[derive(Debug, Clone)]
pub struct HdfsNativeBackend {
root: String,
client: Arc<hdfs_native::Client>,
enable_append: bool,
_enable_append: bool,
}

/// hdfs_native::Client is thread-safe.
Expand All @@ -183,7 +183,7 @@ impl Accessor for HdfsNativeBackend {
todo!()
}

async fn create_dir(&self, path: &str, args: OpCreateDir) -> Result<RpCreateDir> {
async fn create_dir(&self, path: &str, _args: OpCreateDir) -> Result<RpCreateDir> {
let p = build_rooted_abs_path(&self.root, path);

self.client
Expand All @@ -193,7 +193,7 @@ impl Accessor for HdfsNativeBackend {
Ok(RpCreateDir::default())
}

async fn read(&self, path: &str, args: OpRead) -> Result<(RpRead, Self::Reader)> {
async fn read(&self, path: &str, _args: OpRead) -> Result<(RpRead, Self::Reader)> {
let p = build_rooted_abs_path(&self.root, path);

let f = self.client.read(&p).await.map_err(parse_hdfs_error)?;
Expand All @@ -203,7 +203,7 @@ impl Accessor for HdfsNativeBackend {
Ok((RpRead::new(), r))
}

async fn write(&self, path: &str, args: OpWrite) -> Result<(RpWrite, Self::Writer)> {
async fn write(&self, path: &str, _args: OpWrite) -> Result<(RpWrite, Self::Writer)> {
let p = build_rooted_abs_path(&self.root, path);

let f = self
Expand All @@ -217,23 +217,23 @@ impl Accessor for HdfsNativeBackend {
Ok((RpWrite::new(), w))
}

async fn copy(&self, from: &str, to: &str, args: OpCopy) -> Result<RpCopy> {
async fn copy(&self, _from: &str, _to: &str, _args: OpCopy) -> Result<RpCopy> {
todo!()
}

async fn rename(&self, from: &str, to: &str, args: OpRename) -> Result<RpRename> {
async fn rename(&self, _from: &str, _to: &str, _args: OpRename) -> Result<RpRename> {
todo!()
}

async fn stat(&self, path: &str, args: OpStat) -> Result<RpStat> {
async fn stat(&self, _path: &str, _args: OpStat) -> Result<RpStat> {
todo!()
}

async fn delete(&self, path: &str, args: OpDelete) -> Result<RpDelete> {
async fn delete(&self, _path: &str, _args: OpDelete) -> Result<RpDelete> {
todo!()
}

async fn list(&self, path: &str, args: OpList) -> Result<(RpList, Self::Lister)> {
async fn list(&self, path: &str, _args: OpList) -> Result<(RpList, Self::Lister)> {
let p = build_rooted_abs_path(&self.root, path);
let l = HdfsNativeLister::new(p, self.client.clone());
Ok((RpList::default(), Some(l)))
Expand Down
11 changes: 7 additions & 4 deletions core/src/services/hdfs_native/lister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,21 @@ use std::sync::Arc;
use std::task::{Context, Poll};

pub struct HdfsNativeLister {
path: String,
client: Arc<hdfs_native::Client>,
_path: String,
_client: Arc<hdfs_native::Client>,
}

impl HdfsNativeLister {
pub fn new(path: String, client: Arc<hdfs_native::Client>) -> Self {
HdfsNativeLister { path: path, client }
HdfsNativeLister {
_path: path,
_client: client,
}
}
}

impl oio::List for HdfsNativeLister {
fn poll_next(&mut self, cx: &mut Context<'_>) -> Poll<Result<Option<Entry>>> {
fn poll_next(&mut self, _cx: &mut Context<'_>) -> Poll<Result<Option<Entry>>> {
todo!()
}
}
6 changes: 3 additions & 3 deletions core/src/services/hdfs_native/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ use std::io::SeekFrom;
use std::task::{Context, Poll};

pub struct HdfsNativeReader {
f: FileReader,
_f: FileReader,
}

impl HdfsNativeReader {
pub fn new(f: FileReader) -> Self {
HdfsNativeReader { f }
HdfsNativeReader { _f: f }
}
}

impl Read for HdfsNativeReader {
fn poll_read(&mut self, cx: &mut Context<'_>, buf: &mut [u8]) -> Poll<Result<usize>> {
fn poll_read(&mut self, _cx: &mut Context<'_>, _buf: &mut [u8]) -> Poll<Result<usize>> {
todo!()
}

Expand Down
10 changes: 5 additions & 5 deletions core/src/services/hdfs_native/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,25 @@ use hdfs_native::file::FileWriter;
use std::task::{Context, Poll};

pub struct HdfsNativeWriter {
f: FileWriter,
_f: FileWriter,
}

impl HdfsNativeWriter {
pub fn new(f: FileWriter) -> Self {
HdfsNativeWriter { f }
HdfsNativeWriter { _f: f }
}
}

impl oio::Write for HdfsNativeWriter {
fn poll_write(&mut self, cx: &mut Context<'_>, bs: &dyn WriteBuf) -> Poll<Result<usize>> {
fn poll_write(&mut self, _cx: &mut Context<'_>, _bs: &dyn WriteBuf) -> Poll<Result<usize>> {
todo!()
}

fn poll_close(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>> {
fn poll_close(&mut self, _cx: &mut Context<'_>) -> Poll<Result<()>> {
todo!()
}

fn poll_abort(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>> {
fn poll_abort(&mut self, _cx: &mut Context<'_>) -> Poll<Result<()>> {
Poll::Ready(Err(Error::new(
ErrorKind::Unsupported,
"HdfsNativeWriter doesn't support abort",
Expand Down

0 comments on commit 6171833

Please sign in to comment.