From 9f73339e58f97325d0657c5714b0e85e7868c597 Mon Sep 17 00:00:00 2001 From: weisd Date: Mon, 2 Dec 2024 17:40:06 +0800 Subject: [PATCH] init NotificationSys --- Cargo.lock | 2 +- ecstore/Cargo.toml | 1 + ecstore/src/endpoints.rs | 41 +++++++ ecstore/src/global.rs | 15 +++ ecstore/src/heal/heal_commands.rs | 111 +++++++++++++++++- ecstore/src/lib.rs | 4 +- ecstore/src/notification_sys.rs | 53 +++++++++ {rustfs => ecstore}/src/peer_rest_client.rs | 19 ++- ecstore/src/utils/net.rs | 7 +- madmin/Cargo.toml | 1 - madmin/src/heal_command.rs | 110 ----------------- madmin/src/lib.rs | 1 - rustfs/src/config/mod.rs | 3 +- rustfs/src/grpc.rs | 6 +- rustfs/src/main.rs | 34 ++++-- rustfs/src/storage/ecfs.rs | 6 +- rustfs/src/storage/mod.rs | 1 + .../src => rustfs/src/storage}/options.rs | 10 +- 18 files changed, 286 insertions(+), 139 deletions(-) create mode 100644 ecstore/src/notification_sys.rs rename {rustfs => ecstore}/src/peer_rest_client.rs (98%) delete mode 100644 madmin/src/heal_command.rs rename {ecstore/src => rustfs/src/storage}/options.rs (95%) diff --git a/Cargo.lock b/Cargo.lock index 953b6e14f..d443b027a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -655,6 +655,7 @@ dependencies = [ "http", "lazy_static", "lock", + "madmin", "md-5", "netif", "nix 0.29.0", @@ -1454,7 +1455,6 @@ dependencies = [ name = "madmin" version = "0.0.1" dependencies = [ - "ecstore", "psutil", "serde", ] diff --git a/ecstore/Cargo.toml b/ecstore/Cargo.toml index a52874e5c..61adbdb61 100644 --- a/ecstore/Cargo.toml +++ b/ecstore/Cargo.toml @@ -62,6 +62,7 @@ rand.workspace = true pin-project-lite.workspace = true md-5.workspace = true workers.workspace = true +madmin.workspace = true [target.'cfg(not(windows))'.dependencies] diff --git a/ecstore/src/endpoints.rs b/ecstore/src/endpoints.rs index 5bdc086c4..73dd58d7a 100644 --- a/ecstore/src/endpoints.rs +++ b/ecstore/src/endpoints.rs @@ -2,6 +2,7 @@ use crate::{ disk::endpoint::{Endpoint, EndpointType}, disks_layout::DisksLayout, error::{Error, Result}, + global::global_rustfs_port, utils::net, }; use std::{ @@ -529,6 +530,46 @@ impl EndpointServerPools { nodes } + pub fn hosts_sorted(&self) -> Vec<()> { + let (mut peers, local) = self.peers(); + + peers.sort(); + + for peer in peers.iter() { + if &local == peer { + continue; + } + + // FIXME:TODO + } + + unimplemented!() + } + pub fn peers(&self) -> (Vec, String) { + let mut local = None; + let mut set = HashSet::new(); + for ep in self.0.iter() { + for endpoint in ep.endpoints.0.iter() { + if endpoint.get_type() != EndpointType::Url { + continue; + } + let host = endpoint.host_port(); + if endpoint.is_local { + if endpoint.url.port() == Some(global_rustfs_port()) { + if local.is_none() { + local = Some(host.clone()); + } + } + } + + set.insert(host); + } + } + + let hosts: Vec = set.iter().cloned().collect(); + + (hosts, local.unwrap_or_default()) + } } #[cfg(test)] diff --git a/ecstore/src/global.rs b/ecstore/src/global.rs index fdb7f8444..e2c945eea 100644 --- a/ecstore/src/global.rs +++ b/ecstore/src/global.rs @@ -18,7 +18,10 @@ pub const DISK_MIN_INODES: u64 = 1000; pub const DISK_FILL_FRACTION: f64 = 0.99; pub const DISK_RESERVE_FRACTION: f64 = 0.15; +pub const DEFAULT_PORT: u16 = 9000; + lazy_static! { + static ref GLOBAL_RUSTFS_PORT: OnceLock = OnceLock::new(); pub static ref GLOBAL_OBJECT_API: OnceLock> = OnceLock::new(); pub static ref GLOBAL_LOCAL_DISK: Arc>>> = Arc::new(RwLock::new(Vec::new())); pub static ref GLOBAL_IsErasure: RwLock = RwLock::new(false); @@ -33,6 +36,18 @@ lazy_static! { static ref globalDeploymentIDPtr: RwLock = RwLock::new(Uuid::nil()); } +pub fn global_rustfs_port() -> u16 { + if let Some(p) = GLOBAL_RUSTFS_PORT.get() { + p.clone() + } else { + DEFAULT_PORT + } +} + +pub fn set_global_rustfs_port(value: u16) { + GLOBAL_RUSTFS_PORT.set(value).expect("set_global_rustfs_port fail"); +} + pub async fn set_global_deployment_id(id: Uuid) { let mut id_ptr = globalDeploymentIDPtr.write().await; *id_ptr = id diff --git a/ecstore/src/heal/heal_commands.rs b/ecstore/src/heal/heal_commands.rs index 06f97fa13..47fb1b405 100644 --- a/ecstore/src/heal/heal_commands.rs +++ b/ecstore/src/heal/heal_commands.rs @@ -1,4 +1,8 @@ -use std::{path::Path, time::SystemTime}; +use std::{ + collections::{HashMap, HashSet}, + path::Path, + time::SystemTime, +}; use lazy_static::lazy_static; use serde::{Deserialize, Serialize}; @@ -6,15 +10,18 @@ use time::OffsetDateTime; use tokio::sync::RwLock; use crate::{ + config::storageclass::{RRS, STANDARD}, disk::{DeleteOptions, DiskAPI, DiskStore, BUCKET_META_PREFIX, RUSTFS_META_BUCKET}, error::{Error, Result}, global::GLOBAL_BackgroundHealState, heal::heal_ops::HEALING_TRACKER_FILENAME, new_object_layer_fn, - store_api::{BucketInfo, StorageAPI}, + store_api::{BucketInfo, StorageAPI, StorageDisk}, utils::fs::read_file, }; +use super::{background_heal_ops::get_local_disks_to_heal, heal_ops::BG_HEALING_UUID}; + pub type HealScanMode = usize; pub type HealItemType = String; @@ -467,3 +474,103 @@ pub async fn healing(derive_path: &str) -> Result> { Ok(Some(healing_tracker)) } + +#[derive(Debug, Default, Serialize, Deserialize)] +pub struct MRFStatus { + bytes_healed: u64, + items_healed: u64, +} + +#[derive(Debug, Default, Serialize, Deserialize)] +pub struct SetStatus { + pub id: String, + pub pool_index: i32, + pub set_index: i32, + pub heal_status: String, + pub heal_priority: String, + pub total_objects: usize, + pub disks: Vec, +} + +#[derive(Debug, Default, Serialize, Deserialize)] +pub struct BgHealState { + offline_endpoints: Vec, + scanned_items_count: u64, + heal_disks: Vec, + sets: Vec, + mrf: HashMap, + scparity: HashMap, +} + +pub async fn get_local_background_heal_status() -> (BgHealState, bool) { + let (bg_seq, ok) = GLOBAL_BackgroundHealState + .read() + .await + .get_heal_sequence_by_token(BG_HEALING_UUID) + .await; + if !ok { + return (BgHealState::default(), false); + } + let bg_seq = bg_seq.unwrap(); + let mut status = BgHealState { + scanned_items_count: bg_seq.read().await.get_scanned_items_count() as u64, + ..Default::default() + }; + let mut heal_disks_map = HashSet::new(); + for ep in get_local_disks_to_heal().await.iter() { + heal_disks_map.insert(ep.to_string()); + } + + let Some(store) = new_object_layer_fn() else { + let healing = GLOBAL_BackgroundHealState.read().await.get_local_healing_disks().await; + for disk in healing.values() { + status.heal_disks.push(disk.endpoint.clone()); + } + return (status, true); + }; + + let si = store.local_storage_info().await; + let mut indexed = HashMap::new(); + for disk in si.disks.iter() { + let set_idx = format!("{}-{}", disk.pool_index, disk.set_index); + // indexed.insert(set_idx, disk); + indexed.entry(set_idx).or_insert(Vec::new()).push(disk); + } + + for (id, disks) in indexed { + let mut ss = SetStatus { + id, + set_index: disks[0].set_index, + pool_index: disks[0].pool_index, + ..Default::default() + }; + for disk in disks { + ss.disks.push(disk.clone()); + if disk.healing { + ss.heal_status = "healing".to_string(); + ss.heal_priority = "high".to_string(); + status.heal_disks.push(disk.endpoint.clone()); + } + } + ss.disks.sort_by(|a, b| { + if a.pool_index != b.pool_index { + return a.pool_index.cmp(&b.pool_index); + } + if a.set_index != b.set_index { + return a.set_index.cmp(&b.set_index); + } + a.disk_index.cmp(&b.disk_index) + }); + status.sets.push(ss); + } + status.sets.sort_by(|a, b| a.id.cmp(&b.id)); + let backend_info = store.backend_info().await; + status + .scparity + .insert(STANDARD.to_string(), backend_info.standard_sc_parity.unwrap_or_default()); + status + .scparity + .insert(RRS.to_string(), backend_info.rr_sc_parity.unwrap_or_default()); + + (status, true) +} diff --git a/ecstore/src/lib.rs b/ecstore/src/lib.rs index 9c5bbaa3a..c6412a1bf 100644 --- a/ecstore/src/lib.rs +++ b/ecstore/src/lib.rs @@ -11,7 +11,9 @@ pub mod error; mod file_meta; pub mod global; pub mod heal; +pub mod notification_sys; pub mod peer; +mod peer_rest_client; mod quorum; pub mod set_disk; mod sets; @@ -22,7 +24,7 @@ pub mod utils; pub mod bucket; pub mod file_meta_inline; -pub mod options; + pub mod pools; pub mod store_err; pub mod xhttp; diff --git a/ecstore/src/notification_sys.rs b/ecstore/src/notification_sys.rs new file mode 100644 index 000000000..4ea46a1d0 --- /dev/null +++ b/ecstore/src/notification_sys.rs @@ -0,0 +1,53 @@ +use std::sync::OnceLock; + +use crate::endpoints::EndpointServerPools; +use crate::error::{Error, Result}; +use crate::peer_rest_client::PeerRestClient; +use lazy_static::lazy_static; + +lazy_static! { + pub static ref GLOBAL_NotificationSys: OnceLock = OnceLock::new(); +} + +pub async fn new_global_notification_sys(eps: EndpointServerPools) -> Result<()> { + let _ = GLOBAL_NotificationSys + .set(NotificationSys::new(eps).await) + .map_err(|_| Error::msg("init notification_sys fail")); + Ok(()) +} + +pub struct NotificationSys { + pub peer_clients: Vec, + pub all_peer_clients: Vec, +} + +impl NotificationSys { + pub async fn new(eps: EndpointServerPools) -> Self { + let (peer_clients, all_peer_clients) = PeerRestClient::new_clients(eps).await; + Self { + peer_clients, + all_peer_clients, + } + } +} + +pub struct NotificationPeerErr { + pub host: String, + pub err: Option, +} + +impl NotificationSys { + pub async fn delete_policy(&self) -> Vec { + unimplemented!() + } + pub async fn load_policy(&self) -> Vec { + unimplemented!() + } + + pub async fn load_policy_mapping(&self) -> Vec { + unimplemented!() + } + pub async fn delete_user(&self) -> Vec { + unimplemented!() + } +} diff --git a/rustfs/src/peer_rest_client.rs b/ecstore/src/peer_rest_client.rs similarity index 98% rename from rustfs/src/peer_rest_client.rs rename to ecstore/src/peer_rest_client.rs index b52802673..469562e2f 100644 --- a/rustfs/src/peer_rest_client.rs +++ b/ecstore/src/peer_rest_client.rs @@ -1,9 +1,11 @@ use std::{collections::HashMap, io::Cursor, time::SystemTime}; +use crate::{ + admin_server_info::ServerProperties, endpoints::EndpointServerPools, global::is_dist_erasure, + heal::heal_commands::BgHealState, store_api::StorageInfo, +}; use common::error::{Error, Result}; -use ecstore::{admin_server_info::ServerProperties, store_api::StorageInfo}; use madmin::{ - heal_command::BgHealState, health::{Cpus, MemInfo, OsInfo, Partitions, ProcInfo, SysConfig, SysErrors, SysService}, metrics::{CollectMetricsOpts, MetricType, RealtimeMetrics}, net::NetInfo, @@ -21,14 +23,14 @@ use protos::{ }, }; use rmp_serde::{Deserializer, Serializer}; -use serde::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize as _}; use tonic::Request; pub const PEER_RESTSIGNAL: &str = "signal"; pub const PEER_RESTSUB_SYS: &str = "sub-sys"; pub const PEER_RESTDRY_RUN: &str = "dry-run"; -struct PeerRestClient { +pub struct PeerRestClient { addr: String, } @@ -38,6 +40,15 @@ impl PeerRestClient { addr: format!("{}://{}:{}", url.scheme(), url.host_str().unwrap(), url.port().unwrap()), } } + pub async fn new_clients(_eps: EndpointServerPools) -> (Vec, Vec) { + if !is_dist_erasure().await { + return (Vec::new(), Vec::new()); + } + + // FIXME:TODO + + todo!() + } } impl PeerRestClient { diff --git a/ecstore/src/utils/net.rs b/ecstore/src/utils/net.rs index 6301051ce..a1ebcf428 100644 --- a/ecstore/src/utils/net.rs +++ b/ecstore/src/utils/net.rs @@ -2,8 +2,9 @@ use crate::error::{Error, Result}; use lazy_static::lazy_static; use std::{ collections::HashSet, - net::{IpAddr, SocketAddr, ToSocketAddrs}, + net::{IpAddr, SocketAddr, TcpListener, ToSocketAddrs}, }; + use url::Host; lazy_static! { @@ -92,6 +93,10 @@ pub fn get_host_ip(host: Host<&str>) -> Result> { } } +pub fn get_available_port() -> u16 { + TcpListener::bind("0.0.0.0:0").unwrap().local_addr().unwrap().port() +} + /// returns IPs of local interface pub(crate) fn must_get_local_ips() -> Result> { match netif::up() { diff --git a/madmin/Cargo.toml b/madmin/Cargo.toml index d0b8cd6f5..f312d26a6 100644 --- a/madmin/Cargo.toml +++ b/madmin/Cargo.toml @@ -7,6 +7,5 @@ rust-version.workspace = true version.workspace = true [dependencies] -ecstore.workspace = true psutil = "3.3.0" serde.workspace = true diff --git a/madmin/src/heal_command.rs b/madmin/src/heal_command.rs deleted file mode 100644 index 0e26f100d..000000000 --- a/madmin/src/heal_command.rs +++ /dev/null @@ -1,110 +0,0 @@ -use std::collections::{HashMap, HashSet}; - -use ecstore::{ - config::storageclass::{RRS, STANDARD}, - global::GLOBAL_BackgroundHealState, - heal::{background_heal_ops::get_local_disks_to_heal, heal_ops::BG_HEALING_UUID}, - new_object_layer_fn, - store_api::{StorageAPI, StorageDisk}, -}; -use serde::{Deserialize, Serialize}; - -#[derive(Debug, Default, Serialize, Deserialize)] -pub struct MRFStatus { - bytes_healed: u64, - items_healed: u64, -} - -#[derive(Debug, Default, Serialize, Deserialize)] -pub struct SetStatus { - pub id: String, - pub pool_index: i32, - pub set_index: i32, - pub heal_status: String, - pub heal_priority: String, - pub total_objects: usize, - pub disks: Vec, -} - -#[derive(Debug, Default, Serialize, Deserialize)] -pub struct BgHealState { - offline_endpoints: Vec, - scanned_items_count: u64, - heal_disks: Vec, - sets: Vec, - mrf: HashMap, - scparity: HashMap, -} - -pub async fn get_local_background_heal_status() -> (BgHealState, bool) { - let (bg_seq, ok) = GLOBAL_BackgroundHealState - .read() - .await - .get_heal_sequence_by_token(BG_HEALING_UUID) - .await; - if !ok { - return (BgHealState::default(), false); - } - let bg_seq = bg_seq.unwrap(); - let mut status = BgHealState { - scanned_items_count: bg_seq.read().await.get_scanned_items_count() as u64, - ..Default::default() - }; - let mut heal_disks_map = HashSet::new(); - for ep in get_local_disks_to_heal().await.iter() { - heal_disks_map.insert(ep.to_string()); - } - - let Some(store) = new_object_layer_fn() else { - let healing = GLOBAL_BackgroundHealState.read().await.get_local_healing_disks().await; - for disk in healing.values() { - status.heal_disks.push(disk.endpoint.clone()); - } - return (status, true); - }; - - let si = store.local_storage_info().await; - let mut indexed = HashMap::new(); - for disk in si.disks.iter() { - let set_idx = format!("{}-{}", disk.pool_index, disk.set_index); - // indexed.insert(set_idx, disk); - indexed.entry(set_idx).or_insert(Vec::new()).push(disk); - } - - for (id, disks) in indexed { - let mut ss = SetStatus { - id, - set_index: disks[0].set_index, - pool_index: disks[0].pool_index, - ..Default::default() - }; - for disk in disks { - ss.disks.push(disk.clone()); - if disk.healing { - ss.heal_status = "healing".to_string(); - ss.heal_priority = "high".to_string(); - status.heal_disks.push(disk.endpoint.clone()); - } - } - ss.disks.sort_by(|a, b| { - if a.pool_index != b.pool_index { - return a.pool_index.cmp(&b.pool_index); - } - if a.set_index != b.set_index { - return a.set_index.cmp(&b.set_index); - } - a.disk_index.cmp(&b.disk_index) - }); - status.sets.push(ss); - } - status.sets.sort_by(|a, b| a.id.cmp(&b.id)); - let backend_info = store.backend_info().await; - status - .scparity - .insert(STANDARD.to_string(), backend_info.standard_sc_parity.unwrap_or_default()); - status - .scparity - .insert(RRS.to_string(), backend_info.rr_sc_parity.unwrap_or_default()); - - (status, true) -} diff --git a/madmin/src/lib.rs b/madmin/src/lib.rs index 11da4062f..ddd593455 100644 --- a/madmin/src/lib.rs +++ b/madmin/src/lib.rs @@ -1,4 +1,3 @@ -pub mod heal_command; pub mod health; pub mod metrics; pub mod net; diff --git a/rustfs/src/config/mod.rs b/rustfs/src/config/mod.rs index 9a22f758b..f038b3b57 100644 --- a/rustfs/src/config/mod.rs +++ b/rustfs/src/config/mod.rs @@ -1,12 +1,13 @@ use clap::Parser; use const_str::concat; +use ecstore::global::DEFAULT_PORT; shadow_rs::shadow!(build); /// Default port that a rustfs server listens on. /// /// Used if no port is specified. -pub const DEFAULT_PORT: u16 = 9000; + pub const DEFAULT_ACCESS_KEY: &str = "rustfsadmin"; pub const DEFAULT_SECRET_KEY: &str = "rustfsadmin"; diff --git a/rustfs/src/grpc.rs b/rustfs/src/grpc.rs index 7a6c715c9..8ef9d42ba 100644 --- a/rustfs/src/grpc.rs +++ b/rustfs/src/grpc.rs @@ -13,7 +13,10 @@ use ecstore::{ UpdateMetadataOpts, WalkDirOptions, }, erasure::Writer, - heal::{data_usage_cache::DataUsageCache, heal_commands::HealOpts}, + heal::{ + data_usage_cache::DataUsageCache, + heal_commands::{get_local_background_heal_status, HealOpts}, + }, new_object_layer_fn, peer::{LocalPeerS3Client, PeerS3Client}, store::{all_local_disk_path, find_local_disk}, @@ -25,7 +28,6 @@ use lock::{lock_args::LockArgs, Locker, GLOBAL_LOCAL_SERVER}; use common::globals::GLOBAL_Local_Node_Name; use madmin::net::get_net_info; use madmin::{ - heal_command::get_local_background_heal_status, health::{ get_cpus, get_mem_info, get_os_info, get_partitions, get_proc_info, get_sys_config, get_sys_errors, get_sys_services, }, diff --git a/rustfs/src/main.rs b/rustfs/src/main.rs index 9ddde2bfc..453c3e78f 100644 --- a/rustfs/src/main.rs +++ b/rustfs/src/main.rs @@ -1,16 +1,16 @@ mod admin; mod config; mod grpc; -#[allow(dead_code)] -mod peer_rest_client; mod service; mod storage; - use clap::Parser; use common::error::{Error, Result}; +use ecstore::global::set_global_rustfs_port; +use ecstore::utils::net::{self, get_available_port}; use ecstore::{ endpoints::EndpointServerPools, heal::data_scanner::init_data_scanner, + notification_sys::new_global_notification_sys, set_global_endpoints, store::{init_local_disks, ECStore}, update_erasure_type, @@ -71,13 +71,27 @@ fn main() -> Result<()> { async fn run(opt: config::Opt) -> Result<()> { debug!("opt: {:?}", &opt); + let mut server_addr = net::check_local_server_addr(opt.address.as_str()).unwrap(); + + if server_addr.port() == 0 { + server_addr.set_port(get_available_port()); + } + + let server_port = server_addr.port(); + + let server_address = server_addr.to_string(); + + debug!("server_address {}", &server_address); + + set_global_rustfs_port(server_port); + //监听地址,端口从参数中获取 - let listener = TcpListener::bind(opt.address.clone()).await?; + let listener = TcpListener::bind(server_address.clone()).await?; //获取监听地址 let local_addr: SocketAddr = listener.local_addr()?; // 用于rpc - let (endpoint_pools, setup_type) = EndpointServerPools::from_volumes(opt.address.clone().as_str(), opt.volumes.clone()) + let (endpoint_pools, setup_type) = EndpointServerPools::from_volumes(server_address.clone().as_str(), opt.volumes.clone()) .map_err(|err| Error::from_string(err.to_string()))?; for (i, eps) in endpoint_pools.as_ref().iter().enumerate() { @@ -99,7 +113,7 @@ async fn run(opt: config::Opt) -> Result<()> { // 本项目使用s3s库来实现s3服务 let service = { let store = storage::ecfs::FS::new(); - // let mut b = S3ServiceBuilder::new(storage::ecfs::FS::new(opt.address.clone(), endpoint_pools).await?); + // let mut b = S3ServiceBuilder::new(storage::ecfs::FS::new(server_address.clone(), endpoint_pools).await?); let mut b = S3ServiceBuilder::new(store.clone()); //设置AK和SK //其中部份内容从config配置文件中读取 @@ -182,7 +196,7 @@ async fn run(opt: config::Opt) -> Result<()> { }); // init store - let store = ECStore::new(opt.address.clone(), endpoint_pools.clone()) + let store = ECStore::new(server_address.clone(), endpoint_pools.clone()) .await .map_err(|err| Error::from_string(err.to_string()))?; @@ -191,6 +205,12 @@ async fn run(opt: config::Opt) -> Result<()> { Error::from_string(err.to_string()) })?; warn!(" init store success!"); + + new_global_notification_sys(endpoint_pools.clone()).await.map_err(|err| { + error!("new_global_notification_sys faild {:?}", &err); + Error::from_string(err.to_string()) + })?; + // init scanner init_data_scanner().await; diff --git a/rustfs/src/storage/ecfs.rs b/rustfs/src/storage/ecfs.rs index 6000090b6..2d132f253 100644 --- a/rustfs/src/storage/ecfs.rs +++ b/rustfs/src/storage/ecfs.rs @@ -1,3 +1,6 @@ +use super::options::del_opts; +use super::options::extract_metadata; +use super::options::put_opts; use bytes::Bytes; use common::error::Result; use ecstore::bucket::error::BucketMetadataError; @@ -16,9 +19,6 @@ use ecstore::bucket::tagging::decode_tags; use ecstore::bucket::tagging::encode_tags; use ecstore::bucket::versioning_sys::BucketVersioningSys; use ecstore::new_object_layer_fn; -use ecstore::options::del_opts; -use ecstore::options::extract_metadata; -use ecstore::options::put_opts; use ecstore::store_api::BucketOptions; use ecstore::store_api::CompletePart; use ecstore::store_api::DeleteBucketOptions; diff --git a/rustfs/src/storage/mod.rs b/rustfs/src/storage/mod.rs index 400e9a0dc..824760b2a 100644 --- a/rustfs/src/storage/mod.rs +++ b/rustfs/src/storage/mod.rs @@ -1,3 +1,4 @@ pub mod acess; pub mod ecfs; pub mod error; +pub mod options; diff --git a/ecstore/src/options.rs b/rustfs/src/storage/options.rs similarity index 95% rename from ecstore/src/options.rs rename to rustfs/src/storage/options.rs index e2920e19d..88ba4aa1c 100644 --- a/ecstore/src/options.rs +++ b/rustfs/src/storage/options.rs @@ -1,8 +1,8 @@ -use crate::bucket::versioning_sys::BucketVersioningSys; -use crate::error::{Error, Result}; -use crate::store_api::ObjectOptions; -use crate::store_err::StorageError; -use crate::utils::path::is_dir_object; +use ecstore::bucket::versioning_sys::BucketVersioningSys; +use ecstore::error::{Error, Result}; +use ecstore::store_api::ObjectOptions; +use ecstore::store_err::StorageError; +use ecstore::utils::path::is_dir_object; use http::{HeaderMap, HeaderValue}; use lazy_static::lazy_static; use std::collections::HashMap;