todo:rename_data

This commit is contained in:
weisd
2024-07-03 17:47:28 +08:00
parent 3c70c3c6e8
commit 38b62d9d6c
6 changed files with 144 additions and 22 deletions
+10
View File
@@ -4,6 +4,8 @@ use anyhow::Result;
use bytes::Bytes;
use tokio::io::DuplexStream;
use crate::store_api::FileInfo;
#[async_trait::async_trait]
pub trait DiskAPI: Debug + Send + Sync + 'static {
fn is_local(&self) -> bool;
@@ -12,6 +14,14 @@ pub trait DiskAPI: Debug + Send + Sync + 'static {
async fn write_all(&self, volume: &str, path: &str, data: Bytes) -> Result<()>;
async fn rename_file(&self, src_volume: &str, src_path: &str, dst_volume: &str, dst_path: &str) -> Result<()>;
async fn create_file(&self, origvolume: &str, volume: &str, path: &str, fileSize: usize, r: DuplexStream) -> Result<()>;
async fn rename_data(
&self,
src_volume: &str,
src_path: &str,
file_info: &FileInfo,
dst_volume: &str,
dst_path: &str,
) -> Result<()>;
async fn make_volumes(&self, volume: Vec<&str>) -> Result<()>;
async fn make_volume(&self, volume: &str) -> Result<()>;