Skip to main content

iceberg/io/storage/config/
hdfs_native.rs

1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements.  See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership.  The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License.  You may obtain a copy of the License at
8//
9//   http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied.  See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18//! HDFS storage configuration.
19
20/// HDFS NameNode RPC endpoint(s) as `host:port`, e.g. `hdfs://namenode:8020`;
21/// a comma-separated list enables HA failover. Serves authority-less paths
22/// (`hdfs:///path`) only; a path authority with a port is used as is. A
23/// portless authority (`hdfs://ns1/path`) must be a nameservice declared in
24/// properties: `hdfs.name-node.<nameservice>` takes the same list and is
25/// sugar for Hadoop's `dfs.ha.namenodes.<nameservice>` and
26/// `dfs.namenode.rpc-address.<nameservice>.<id>`, which are honored as well
27/// when passed through [`HDFS_HADOOP_CONF_PREFIX`]. Unlike Hadoop, an
28/// undeclared one is an error: it is neither resolved from
29/// `$HADOOP_CONF_DIR` nor dialed on the default port 8020.
30pub const HDFS_NAME_NODE: &str = "hdfs.name-node";
31/// NameNode host for authority-less paths, as in PyIceberg; paths that carry
32/// an authority ignore it, as they do there. Combined with [`HDFS_PORT`] into
33/// Hadoop's `fs.defaultFS`. PyIceberg's `hdfs.user` and `hdfs.kerberos_ticket`
34/// have no equivalent: the client reads `HADOOP_USER_NAME` and the default
35/// Kerberos credential cache.
36pub const HDFS_HOST: &str = "hdfs.host";
37/// NameNode port for [`HDFS_HOST`]; defaults to `8020` and has no effect
38/// without the host.
39pub const HDFS_PORT: &str = "hdfs.port";
40/// Prefix for properties forwarded to the HDFS client configuration with the
41/// prefix stripped: `hadoop.dfs.client.failover.random.order` is forwarded as
42/// `dfs.client.failover.random.order`. Forwarded values override those loaded
43/// from `$HADOOP_CONF_DIR`; `hadoop.fs.defaultFS` also serves authority-less
44/// paths.
45pub const HDFS_HADOOP_CONF_PREFIX: &str = "hadoop.";