hdfs_native/lib.rs
1// #![warn(missing_docs)]
2//! Native HDFS client implementation in Rust
3//!
4//! # Usage
5//!
6//! Create a client to a single NameNode
7//! ```rust
8//! use hdfs_native::Client;
9//! # use hdfs_native::Result;
10//! # fn main() -> Result<()> {
11//! let client = Client::new("hdfs://localhost:9000")?;
12//! # Ok(())
13//! # }
14//! ```
15//!
16//! Create a client for a Name Service
17//! ```rust
18//! use std::collections::HashMap;
19//! use hdfs_native::Client;
20//! # use hdfs_native::Result;
21//! # fn main() -> Result<()> {
22//! let config = HashMap::from([
23//! ("dfs.ha.namenodes.ns".to_string(), "nn-1,nn-2".to_string()),
24//! ("dfs.namenode.rpc-address.ns.nn-1".to_string(), "nn-1:9000".to_string()),
25//! ("dfs.namenode.rpc-address.ns.nn-2".to_string(), "nn-2:9000".to_string()),
26//! ]);
27//! let client = Client::new_with_config("hdfs://ns", config)?;
28//! # Ok(())
29//! # }
30//! ```
31pub mod acl;
32pub mod client;
33pub(crate) mod common;
34#[cfg(feature = "benchmark")]
35pub mod ec;
36#[cfg(not(feature = "benchmark"))]
37pub(crate) mod ec;
38pub(crate) mod error;
39pub mod file;
40pub(crate) mod hdfs;
41#[cfg(any(feature = "integration-test", feature = "benchmark"))]
42pub mod minidfs;
43pub(crate) mod proto;
44pub(crate) mod security;
45
46pub use client::Client;
47pub use client::WriteOptions;
48pub use error::HdfsError;
49pub use error::Result;
50
51// Module for testing hooks into non-test code
52#[cfg(feature = "integration-test")]
53pub mod test;