9 configuration options · available in Rust, Python, Node.js
use opendal::Operator;
let operator = Operator::via_iter("hdfs-native", [
])?;
use opendal::Operator;
let operator = Operator::via_iter("hdfs-native", [
// --- General ---
// work dir of this backend
// ("root".to_string(), "...".to_string()),
// name_node of this backend
// ("name_node".to_string(), "...".to_string()),
// Hadoop configuration properties for the client, such as
// `dfs.client.socket-timeout`.
//
// These properties override the values from the Hadoop configuration
// files. See `config_dir` for the files the client reads.
// ("options".to_string(), "{\"key\":\"value\"}".to_string()),
// Directory that contains the Hadoop configuration files.
//
// The client reads `core-site.xml`, `hdfs-site.xml`, `yarn-site.xml`, and
// `mapred-site.xml` from one directory: `config_dir` when it is set,
// otherwise `HADOOP_CONF_DIR`, otherwise `$HADOOP_HOME/etc/hadoop`. Setting
// `config_dir` stops the client from reading the files in
// `HADOOP_CONF_DIR` and `HADOOP_HOME`. Properties in `options` override
// the values from these files.
//
// Building the service fails with `ConfigInvalid` when `config_dir` is
// not a directory.
// ("config_dir".to_string(), "/etc/hadoop/conf".to_string()),
// --- Credentials ---
// HDFS user that the client acts as.
//
// Without Kerberos, the NameNode accepts this name as the caller. When
// `user` is unset, the client uses `HADOOP_USER_NAME`, then the operating
// system user.
//
// With Kerberos, the authenticated principal impersonates this user. The
// cluster must allow the impersonation through its `hadoop.proxyuser.*`
// settings. When `user` is unset, the client uses `HADOOP_PROXY_USER`;
// when that is also unset, it acts as the principal.
// ("user".to_string(), "alice".to_string()),
// Kerberos principal that the client authenticates as.
//
// Set `hadoop.security.authentication` to `kerberos` in `options` or in
// the Hadoop configuration files. With any `kerberos_*` option, building
// the service, for example through `Operator::new`, fails with
// `ConfigInvalid` when the effective value is unset or exactly `simple`,
// because the client would ignore the Kerberos settings and connect with
// simple authentication. Other values pass this check, and building does
// not connect to the cluster, so other authentication problems surface on
// the first operation.
//
// Without `kerberos_keytab` or `kerberos_cache`, the client looks up this
// principal's tickets in the default credential cache. When no
// `kerberos_*` option is set, a client with Kerberos authentication uses
// the default principal of the default credential cache.
// ("kerberos_principal".to_string(), "alice@EXAMPLE.COM".to_string()),
// Path to the keytab that the client obtains Kerberos tickets from.
//
// Requires `kerberos_principal`. The client keeps the tickets in an
// in-memory credential cache that belongs to this service, unless
// `kerberos_cache` is set.
// ("kerberos_keytab".to_string(), "/etc/security/keytabs/alice.keytab".to_string()),
// Kerberos credential cache that the client reads tickets from.
//
// Requires `kerberos_principal`. With `kerberos_keytab`, the client also
// stores the tickets it obtains from the keytab in this cache.
// ("kerberos_cache".to_string(), "FILE:/tmp/krb5cc_alice".to_string()),
])?;
Every option is passed as a string key; OpenDAL parses it into the right type. For a map option, pass a string containing a JSON object whose values are strings, such as {"key":"value"}. Some services may require building the binding with the matching services-* feature enabled.
| Key | Type | Required | Description |
|---|---|---|---|
root | string | no | work dir of this backend |
name_node | string | no | name_node of this backend |
options | map | no | Hadoop configuration properties for the client, such as
dfs.client.socket-timeout.
These properties override the values from the Hadoop configuration
files. See config_dir for the files the client reads. |
config_dire.g. /etc/hadoop/conf | string | no | Directory that contains the Hadoop configuration files.
The client reads core-site.xml, hdfs-site.xml, yarn-site.xml, and
mapred-site.xml from one directory: config_dir when it is set,
otherwise HADOOP_CONF_DIR, otherwise $HADOOP_HOME/etc/hadoop. Setting
config_dir stops the client from reading the files in
HADOOP_CONF_DIR and HADOOP_HOME. Properties in options override
the values from these files.
Building the service fails with ConfigInvalid when config_dir is
not a directory. |
| Key | Type | Required | Description |
|---|---|---|---|
usere.g. alice | string | no | HDFS user that the client acts as.
Without Kerberos, the NameNode accepts this name as the caller. When
user is unset, the client uses HADOOP_USER_NAME, then the operating
system user.
With Kerberos, the authenticated principal impersonates this user. The
cluster must allow the impersonation through its hadoop.proxyuser.*
settings. When user is unset, the client uses HADOOP_PROXY_USER;
when that is also unset, it acts as the principal. |
kerberos_principale.g. alice@EXAMPLE.COM | string | no | Kerberos principal that the client authenticates as.
Set hadoop.security.authentication to kerberos in options or in
the Hadoop configuration files. With any kerberos_* option, building
the service, for example through Operator::new, fails with
ConfigInvalid when the effective value is unset or exactly simple,
because the client would ignore the Kerberos settings and connect with
simple authentication. Other values pass this check, and building does
not connect to the cluster, so other authentication problems surface on
the first operation.
Without kerberos_keytab or kerberos_cache, the client looks up this
principal's tickets in the default credential cache. When no
kerberos_* option is set, a client with Kerberos authentication uses
the default principal of the default credential cache. |
kerberos_keytabe.g. /etc/security/keytabs/alice.keytab | string | no | Path to the keytab that the client obtains Kerberos tickets from.
Requires kerberos_principal. The client keeps the tickets in an
in-memory credential cache that belongs to this service, unless
kerberos_cache is set. |
kerberos_cachee.g. FILE:/tmp/krb5cc_alice | string | no | Kerberos credential cache that the client reads tickets from.
Requires kerberos_principal. With kerberos_keytab, the client also
stores the tickets it obtains from the keytab in this cache. |
| Key | Type | Required | Description |
|---|---|---|---|
enable_appenddeprecated | bool | no | Deprecated: HDFS Native append capability is enabled by default. Deprecated since 0.57.0: HDFS Native append capability is enabled by default and this option is no longer needed. |
Entries reflect native capabilities declared by the hdfs-native backend. Language bindings expose different subsets of options and may simulate operations client-side, and protocol-compatible endpoints may support only a subset of the declared features.
| Capability | Support | Description |
|---|---|---|
stat | Native | Indicates if the operator supports metadata retrieval operations. |
| Capability | Support | Description |
|---|---|---|
read | Native | Indicates if the operator supports read operations. |
| Capability | Support | Description |
|---|---|---|
write | Native | Indicates if the operator supports write operations. |
write_can_multi | Native | Indicates if multiple write operations can be performed on the same object. |
write_can_empty | Native | Indicates if writing empty content is supported. |
write_can_append | Native | Indicates if append operations are supported. |
write_with_if_not_exists | Native | Indicates if write operations can be conditional on object non-existence. |
| Capability | Support | Description |
|---|---|---|
list | Native | Indicates if list operations are supported. |
| Capability | Support | Description |
|---|---|---|
delete | Native | Indicates if delete operations are supported. |
delete_with_recursive | Native | Indicates if recursive delete operations are supported. |
| Capability | Support | Description |
|---|---|---|
create_dir | Native | Indicates if directory creation is supported. |
rename | Native | Indicates if rename operations are supported. |
rename_with_if_not_exists | Native | Indicates if conditional rename operations with if-not-exists are supported. |
shared | Native | Indicate if the operator supports shared access. |