liurenjie1024 commented on code in PR #499:
URL: https://github.com/apache/iceberg-rust/pull/499#discussion_r1695271890


##########
crates/iceberg/src/io/storage_memory.rs:
##########
@@ -15,31 +15,11 @@
 // specific language governing permissions and limitations
 // under the License.
 
-use std::collections::HashMap;
-use std::fmt::{Debug, Formatter};
-
-use opendal::{Operator, Scheme};
+use opendal::services::MemoryConfig;
+use opendal::Operator;
 
 use crate::Result;
 
-#[derive(Default, Clone)]
-pub(crate) struct MemoryConfig {}
-
-impl Debug for MemoryConfig {
-    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
-        f.debug_struct("MemoryConfig").finish()
-    }
-}
-
-impl MemoryConfig {
-    /// Decode from iceberg props.
-    pub fn new(_: HashMap<String, String>) -> Self {
-        Self::default()
-    }
-
-    /// Build new opendal operator from given path.
-    pub fn build(&self, _: &str) -> Result<Operator> {
-        let m = HashMap::new();
-        Ok(Operator::via_map(Scheme::Memory, m)?)
-    }
+pub(crate) fn memory_config_build(_: &str) -> Result<Operator> {

Review Comment:
   It seems that path is not used here, why we need to pass it?



##########
crates/iceberg/src/io/storage_fs.rs:
##########
@@ -15,37 +15,15 @@
 // specific language governing permissions and limitations
 // under the License.
 
-use std::collections::HashMap;
-use std::fmt::{Debug, Formatter};
-
-use opendal::{Operator, Scheme};
+use opendal::services::FsConfig;
+use opendal::Operator;
 
 use crate::Result;
 
-/// # TODO
-///
-/// opendal has a plan to introduce native config support.
-/// We manually parse the config here and those code will be finally removed.
-#[derive(Default, Clone)]
-pub(crate) struct FsConfig {}
-
-impl Debug for FsConfig {
-    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
-        f.debug_struct("FsConfig").finish()
-    }
-}
-
-impl FsConfig {
-    /// Decode from iceberg props.
-    pub fn new(_: HashMap<String, String>) -> Self {
-        Self::default()
-    }
+/// Build new opendal operator from give path.
+pub(crate) fn fs_config_build(_: &str) -> Result<Operator> {

Review Comment:
   Ditto.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to