From 98f48ba067fc4f349f58b26f9cb8a4b1f82746f2 Mon Sep 17 00:00:00 2001 From: weisd Date: Thu, 26 Sep 2024 16:04:20 +0800 Subject: [PATCH] merge remote support --- ecstore/src/disk/local.rs | 16 +++++++--------- ecstore/src/disk/mod.rs | 2 +- ecstore/src/disk/os.rs | 1 - ecstore/src/disk/remote.rs | 1 - 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/ecstore/src/disk/local.rs b/ecstore/src/disk/local.rs index 80f2344ce..adbec6939 100644 --- a/ecstore/src/disk/local.rs +++ b/ecstore/src/disk/local.rs @@ -18,16 +18,14 @@ use crate::{ store_api::{FileInfo, RawFileInfo}, utils, }; -use bytes::Bytes; use path_absolutize::Absolutize; -use std::io::Read; use std::{ fs::Metadata, path::{Path, PathBuf}, }; -use time::{util, OffsetDateTime}; +use time::OffsetDateTime; use tokio::fs::{self, File}; -use tokio::io::{self, AsyncReadExt, AsyncWriteExt, ErrorKind}; +use tokio::io::{AsyncReadExt, AsyncWriteExt, ErrorKind}; use tokio::sync::Mutex; use tracing::{debug, warn}; use uuid::Uuid; @@ -1343,12 +1341,12 @@ impl DiskAPI for LocalDisk { async fn delete_version( &self, volume: &str, - path: &str, - fi: FileInfo, - force_del_marker: bool, - opts: DeleteOptions, + _path: &str, + _fi: FileInfo, + _force_del_marker: bool, + _opts: DeleteOptions, ) -> Result { - let volume_dir = self.get_bucket_path(&volume)?; + let _volume_dir = self.get_bucket_path(&volume)?; // self.read_all_data(bucket, volume_dir, path); diff --git a/ecstore/src/disk/mod.rs b/ecstore/src/disk/mod.rs index 9aaeaa392..b691afff6 100644 --- a/ecstore/src/disk/mod.rs +++ b/ecstore/src/disk/mod.rs @@ -19,7 +19,7 @@ use crate::{ file_meta::FileMeta, store_api::{FileInfo, RawFileInfo}, }; -use bytes::Bytes; + use endpoint::Endpoint; use protos::proto_gen::node_service::{node_service_client::NodeServiceClient, ReadAtRequest, WriteRequest}; use serde::{Deserialize, Serialize}; diff --git a/ecstore/src/disk/os.rs b/ecstore/src/disk/os.rs index 680428cb8..78d0ada5c 100644 --- a/ecstore/src/disk/os.rs +++ b/ecstore/src/disk/os.rs @@ -3,7 +3,6 @@ use std::{ path::{Component, Path}, }; -use futures::TryFutureExt; use tokio::fs; use crate::{ diff --git a/ecstore/src/disk/remote.rs b/ecstore/src/disk/remote.rs index 3186a52bc..47165da51 100644 --- a/ecstore/src/disk/remote.rs +++ b/ecstore/src/disk/remote.rs @@ -1,6 +1,5 @@ use std::{path::PathBuf, sync::Arc, time::Duration}; -use bytes::Bytes; use futures::lock::Mutex; use protos::{ node_service_time_out_client,