Skip to main content

hdfs-native

9 configuration options · available in Rust, Python, Node.js

Quick start
use opendal::Operator;

let operator = Operator::via_iter("hdfs-native", [
])?;
All configuration options (copy & trim)
Full reference
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.

Configuration reference​

General4
KeyTypeRequiredDescription
rootstringnowork dir of this backend
name_nodestringnoname_node of this backend
optionsmapnoHadoop 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/confstringnoDirectory 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.
Credentials4
KeyTypeRequiredDescription
usere.g. alicestringnoHDFS 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.COMstringnoKerberos 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.keytabstringnoPath 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_alicestringnoKerberos 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.
Deprecated1
KeyTypeRequiredDescription
enable_appenddeprecatedboolnoDeprecated: 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.

Stat1
CapabilitySupportDescription
stat NativeIndicates if the operator supports metadata retrieval operations.
Read1
CapabilitySupportDescription
read NativeIndicates if the operator supports read operations.
Write5
CapabilitySupportDescription
write NativeIndicates if the operator supports write operations.
write_can_multi NativeIndicates if multiple write operations can be performed on the same object.
write_can_empty NativeIndicates if writing empty content is supported.
write_can_append NativeIndicates if append operations are supported.
write_with_if_not_exists NativeIndicates if write operations can be conditional on object non-existence.
List1
CapabilitySupportDescription
list NativeIndicates if list operations are supported.
Delete2
CapabilitySupportDescription
delete NativeIndicates if delete operations are supported.
delete_with_recursive NativeIndicates if recursive delete operations are supported.
Other4
CapabilitySupportDescription
create_dir NativeIndicates if directory creation is supported.
rename NativeIndicates if rename operations are supported.
rename_with_if_not_exists NativeIndicates if conditional rename operations with if-not-exists are supported.
shared NativeIndicate if the operator supports shared access.