blackmwk commented on code in PR #3111: URL: https://github.com/apache/iceberg-rust/pull/3111#discussion_r3932278311
########## crates/iceberg/src/io/storage/config/hdfs.rs: ########## @@ -0,0 +1,80 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +//! HDFS storage configuration. + +use std::collections::HashMap; + +use iceberg_property_macro::Properties; + +/// HDFS NameNode RPC endpoint(s), e.g. `hdfs://namenode:8020`; a +/// comma-separated list enables HA failover. When unset, the NameNode is +/// derived from the path authority. +pub const HDFS_NAME_NODE: &str = "hdfs.name-node"; +/// Prefix for properties forwarded to the HDFS client configuration, e.g. +/// `hadoop.dfs.client.failover.random.order`. Forwarded values (prefix +/// stripped) override those loaded from `$HADOOP_CONF_DIR`. +pub const HDFS_HADOOP_CONF_PREFIX: &str = "hadoop."; + +/// HDFS storage configuration. +// No in-crate consumer yet: `iceberg-storage-opendal` parses the raw +// properties itself and only shares the key constants above. +#[allow(dead_code)] Review Comment: No, we don't need this, make this `HdfsConfig` pub ########## crates/storage/opendal/src/hdfs.rs: ########## Review Comment: Rename this to hdfs_native. ########## crates/storage/opendal/src/hdfs.rs: ########## @@ -0,0 +1,349 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +//! HDFS storage backend via OpenDAL's `services-hdfs-native` (pure Rust, no JNI). + +use std::collections::HashMap; +use std::sync::RwLock; + +use iceberg::io::{HDFS_HADOOP_CONF_PREFIX, HDFS_NAME_NODE}; +use iceberg::{Error, ErrorKind, Result}; +use opendal::Operator; +use opendal::services::HdfsNativeConfig; +use url::Url; + +use crate::utils::from_opendal_error; + +/// Parse iceberg properties to [`HdfsNativeConfig`]. +pub(crate) fn hdfs_config_parse(mut m: HashMap<String, String>) -> Result<HdfsNativeConfig> { Review Comment: All functions should have prefix hdfs_native ########## crates/iceberg/src/io/storage/config/hdfs.rs: ########## @@ -0,0 +1,80 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +//! HDFS storage configuration. + +use std::collections::HashMap; + +use iceberg_property_macro::Properties; + +/// HDFS NameNode RPC endpoint(s), e.g. `hdfs://namenode:8020`; a +/// comma-separated list enables HA failover. When unset, the NameNode is +/// derived from the path authority. +pub const HDFS_NAME_NODE: &str = "hdfs.name-node"; +/// Prefix for properties forwarded to the HDFS client configuration, e.g. +/// `hadoop.dfs.client.failover.random.order`. Forwarded values (prefix +/// stripped) override those loaded from `$HADOOP_CONF_DIR`. +pub const HDFS_HADOOP_CONF_PREFIX: &str = "hadoop."; + +/// HDFS storage configuration. +// No in-crate consumer yet: `iceberg-storage-opendal` parses the raw +// properties itself and only shares the key constants above. +#[allow(dead_code)] Review Comment: Seems this have never been used? I think we could remove it? -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
