hdfs-client 0.2.0

hdfs rust native client
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::io::Read;

use hdfs_client::HDFS;

fn main() {
    tracing_subscriber::fmt()
        .with_max_level(tracing::Level::TRACE)
        .pretty()
        .init();
    let mut fs = HDFS::connect("127.0.0.1:9000", "root").unwrap();
    let mut fd = fs.open("/test/hello.txt").unwrap();
    let mut content = String::new();
    fd.read_to_string(&mut content).unwrap();
    println!("{content}");
}