mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-10 23:26:53 +00:00
init metacache io
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ pub mod store;
|
|||||||
pub mod store_api;
|
pub mod store_api;
|
||||||
pub mod store_err;
|
pub mod store_err;
|
||||||
mod store_init;
|
mod store_init;
|
||||||
mod store_list_objects;
|
pub mod store_list_objects;
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
pub mod xhttp;
|
pub mod xhttp;
|
||||||
|
|
||||||
|
|||||||
+21
-21
@@ -1016,32 +1016,32 @@ pub struct PoolObjInfo {
|
|||||||
pub err: Option<Error>,
|
pub err: Option<Error>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone)]
|
// #[derive(Debug, Default, Clone)]
|
||||||
pub struct ListPathOptions {
|
// pub struct ListPathOptions {
|
||||||
pub id: String,
|
// pub id: String,
|
||||||
|
|
||||||
// Bucket of the listing.
|
// // Bucket of the listing.
|
||||||
pub bucket: String,
|
// pub bucket: String,
|
||||||
|
|
||||||
// Directory inside the bucket.
|
// // Directory inside the bucket.
|
||||||
// When unset listPath will set this based on Prefix
|
// // When unset listPath will set this based on Prefix
|
||||||
pub base_dir: String,
|
// pub base_dir: String,
|
||||||
|
|
||||||
// Scan/return only content with prefix.
|
// // Scan/return only content with prefix.
|
||||||
pub prefix: String,
|
// pub prefix: String,
|
||||||
|
|
||||||
// FilterPrefix will return only results with this prefix when scanning.
|
// // FilterPrefix will return only results with this prefix when scanning.
|
||||||
// Should never contain a slash.
|
// // Should never contain a slash.
|
||||||
// Prefix should still be set.
|
// // Prefix should still be set.
|
||||||
pub filter_prefix: String,
|
// pub filter_prefix: String,
|
||||||
|
|
||||||
// Marker to resume listing.
|
// // Marker to resume listing.
|
||||||
// The response will be the first entry >= this object name.
|
// // The response will be the first entry >= this object name.
|
||||||
pub marker: String,
|
// pub marker: String,
|
||||||
|
|
||||||
// Limit the number of results.
|
// // Limit the number of results.
|
||||||
pub limit: i32,
|
// pub limit: i32,
|
||||||
}
|
// }
|
||||||
|
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
impl ObjectIO for ECStore {
|
impl ObjectIO for ECStore {
|
||||||
@@ -1521,7 +1521,7 @@ impl StorageAPI for ECStore {
|
|||||||
fetch_owner: bool,
|
fetch_owner: bool,
|
||||||
start_after: &str,
|
start_after: &str,
|
||||||
) -> Result<ListObjectsV2Info> {
|
) -> Result<ListObjectsV2Info> {
|
||||||
self.inner_list_objects_v2(&bucket, &prefix, &continuation_token, &delimiter, max_keys, fetch_owner, start_after)
|
self.inner_list_objects_v2(bucket, prefix, continuation_token, delimiter, max_keys, fetch_owner, start_after)
|
||||||
.await
|
.await
|
||||||
|
|
||||||
// let opts = ListPathOptions {
|
// let opts = ListPathOptions {
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ impl ECStore {
|
|||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn list_path(&self, o: &ListPathOptions) -> Result<ListObjectsInfo> {
|
pub async fn list_path(&self, o: &ListPathOptions) -> Result<ListObjectsInfo> {
|
||||||
check_list_objs_args(&o.bucket, &o.prefix, &o.marker)?;
|
check_list_objs_args(&o.bucket, &o.prefix, &o.marker)?;
|
||||||
// if opts.prefix.ends_with(SLASH_SEPARATOR) {
|
// if opts.prefix.ends_with(SLASH_SEPARATOR) {
|
||||||
// return Err(Error::msg("eof"));
|
// return Err(Error::msg("eof"));
|
||||||
|
|||||||
@@ -2,8 +2,9 @@ use std::{collections::HashMap, path::Path, sync::Arc};
|
|||||||
|
|
||||||
use ecstore::{
|
use ecstore::{
|
||||||
config::error::is_not_found,
|
config::error::is_not_found,
|
||||||
store::{ECStore, ListPathOptions},
|
store::ECStore,
|
||||||
store_api::{HTTPRangeSpec, ObjectIO, ObjectInfo, ObjectOptions, PutObjReader},
|
store_api::{HTTPRangeSpec, ObjectIO, ObjectInfo, ObjectOptions, PutObjReader},
|
||||||
|
store_list_objects::ListPathOptions,
|
||||||
utils::path::dir,
|
utils::path::dir,
|
||||||
};
|
};
|
||||||
use futures::future::try_join_all;
|
use futures::future::try_join_all;
|
||||||
@@ -42,14 +43,11 @@ impl ObjectStore {
|
|||||||
futures.push(async move {
|
futures.push(async move {
|
||||||
let items = self
|
let items = self
|
||||||
.object_api
|
.object_api
|
||||||
.list_path(
|
.list_path(&ListPathOptions {
|
||||||
&ListPathOptions {
|
bucket: Self::BUCKET_NAME.into(),
|
||||||
bucket: Self::BUCKET_NAME.into(),
|
prefix: prefix.clone(),
|
||||||
prefix: prefix.clone(),
|
..Default::default()
|
||||||
..Default::default()
|
})
|
||||||
},
|
|
||||||
"",
|
|
||||||
)
|
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
match items {
|
match items {
|
||||||
|
|||||||
Reference in New Issue
Block a user