chitralverma opened a new issue, #9038:
URL: https://github.com/apache/opendal/issues/9038
### Feature Description
Let string-keyed configuration (`Operator::from_iter`, `Operator::from_uri`
query options, and bindings) set the `hdfs-native` client settings that the
Rust builder already accepts:
1. Hadoop settings in `HdfsNativeConfig::options`.
2. The `hdfs-native` client's explicit identity: `ClientBuilder::with_user`,
`with_kerberos_principal`, `with_kerberos_keytab` and `with_kerberos_cache`.
### Problem and Solution
**Hadoop settings.** `options` is `Option<HashMap<String, String>>`.
`ConfigDeserializer` reads every value as a string, so a string map cannot fill
it:
```rust
Operator::from_iter::<HdfsNative>([
("name_node".into(), "default".into()),
("options".into(), "fs.defaultFS=hdfs://127.0.0.1:9000".into()),
])
// ConfigInvalid => failed to deserialize config, source: invalid type:
string "...", expected a map
Operator::from_iter::<HdfsNative>([
("name_node".into(), "default".into()),
("options.fs.defaultFS".into(), "hdfs://127.0.0.1:9000".into()),
])
// key ignored => invalid argument: No fs.defaultFS setting found
```
So callers that configure services from string maps must ship Hadoop XML
files and set `HADOOP_CONF_DIR` for every client setting: HA addresses, wire
protection, `dfs.client.use.datanode.hostname`, the KMS URI, and so on. With
#9016, `name_node = "default"` and logical nameservices also need
`fs.defaultFS` and `dfs.ha.*` from those files.
A possible solution: forward keys with a fixed prefix, for example `hadoop.`
or `options.`, from the string map into `options`. Hadoop keys contain dots, so
a prefix is less ambiguous than a separator.
**Identity.** `HdfsNativeConfig` has no fields for a user, a Kerberos
principal, a keytab or a credential cache, and the builder does not call these
methods. The client then takes the user from the environment
(`HADOOP_USER_NAME` or `HADOOP_PROXY_USER`) and Kerberos credentials from the
process's default ticket cache. So every `hdfs-native` operator in a process
has the same identity.
A possible solution: add `user`, `kerberos_principal`, `kerberos_keytab` and
`kerberos_cache` to `HdfsNativeConfig`, and pass them to `ClientBuilder`.
### Additional Context
- Checked against main (d86cd9245) with #9016 merged on top. The two
`from_iter` results above come from a test run against that build.
- `hdfs-native` 0.15.1 documents the Kerberos builder methods in its README
under "Kerberos Support".
### Are you willing to contribute to the development of this feature?
- [x] Yes, I am willing to contribute to the development of this feature.
--
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]