This is an automated email from the ASF dual-hosted git repository. xuanwo pushed a commit to branch stat_metakey in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
commit 97355e8bca99ed0dd5d0507377072c313eb22193 Author: Xuanwo <[email protected]> AuthorDate: Tue Nov 21 02:49:23 2023 +0800 chore: Polish docs for Capability Signed-off-by: Xuanwo <[email protected]> --- core/src/types/capability.rs | 20 +++++++++++++++----- core/src/types/list.rs | 1 - 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/core/src/types/capability.rs b/core/src/types/capability.rs index 4e85f4106..20119ae1b 100644 --- a/core/src/types/capability.rs +++ b/core/src/types/capability.rs @@ -16,6 +16,7 @@ // under the License. use std::fmt::Debug; + /// Capability is used to describe what operations are supported /// by current Operator. /// @@ -29,12 +30,21 @@ use std::fmt::Debug; /// /// # Notes /// -/// Capabilities reflects the native support for operations. It's possible -/// that some operations are not supported by current Operator, but still -/// can be used. +/// Every operator has two capabilities: +/// +/// - [`OperatorInfo::native_capability`][crate::OperatorInfo::native_capability] reflects the native +/// support for operations. +/// - [`OperatorInfo::full_capability`][crate::OperatorInfo::full_capability] reflects the full support +/// for operations. +/// +/// It's possible that some operations are not supported by current Operator, but still +/// can be used. For examples: +/// +/// - S3 doesn't support `seek` natively, but we implement it via `range` header. +/// - S3 doesn't support blocking API, but `BlockingLayer` makes it possible. /// -/// For examples, we will support `seek` and `next` for all readers -/// returned by services. +/// Users can use full_capability to decide what operations can be used and use native_capability to +/// decide if this operation optimized or not. /// /// # Naming Style /// diff --git a/core/src/types/list.rs b/core/src/types/list.rs index ce511155a..3611f7c1a 100644 --- a/core/src/types/list.rs +++ b/core/src/types/list.rs @@ -99,7 +99,6 @@ impl Stream for Lister { match ready!(self.lister.poll_next(cx)) { Ok(Some(oe)) => { let (path, metadata) = oe.into_entry().into_parts(); - // TODO: we can optimize this by checking the provided metakey provided by services. if metadata.contains_metakey(self.required_metakey) { return Poll::Ready(Some(Ok(Entry::new(path, metadata)))); }
