From b971b479d2c1f46ee722b41f97d9f192562d7c4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Milenkovi=C4=87?= Date: Thu, 16 Nov 2023 16:16:52 +0000 Subject: [PATCH] minor cleanup --- Cargo.toml | 2 +- README.md | 15 +++++++++++---- src/lib.rs | 4 +++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3dd0f0a..0998376 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.2.0" edition = "2021" license = "MIT" -description = "HDFS Test Container" +description = "Opinionated single node HDFS cluster captured in a testcontainer." homepage = "https://github.com/milenkovicm/testcontainers-minidfs-rs" repository = "https://github.com/milenkovicm/testcontainers-minidfs-rs" readme = "README.md" diff --git a/README.md b/README.md index 6cdfdb6..61917ce 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,18 @@ -# MiniDFS Cluster +# Opinionated Single Node HDFS Cluster Testcontainer [![github action](https://github.com/milenkovicm/testcontainers-minidfs-rs/actions/workflows/basic.yml/badge.svg)](https://github.com/milenkovicm/testcontainers-minidfs-rs/actions/workflows/basic.yml) [![Crates.io](https://img.shields.io/crates/v/testcontainers-minidfs-rs)](https://crates.io/crates/testcontainers-minidfs-rs) [![Crates.io](https://img.shields.io/crates/d/testcontainers-minidfs-rs)](https://crates.io/crates/testcontainers-minidfs-rs) -Testcontainer HDFS cluster using hadoop mini DFS. +Opinionated single node HDFS (DFS) cluster captured in a testcontainer. -```rust +```toml +testcontainers-minidfs-rs = "0.2" +``` + +Example: + +```rust, no_run use testcontainers::clients; use testcontainers_minidfs_rs::*; @@ -51,4 +57,5 @@ All required files needed for hdfs client setup are exposed. (`kinit` will be ex ## Limitations -- ports are hardcoded, thus only single instance per host is possible +- Ports are hardcoded, thus only single instance per host is possible +- Not many configuration option can be tunned diff --git a/src/lib.rs b/src/lib.rs index cf42b40..969bb64 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,9 @@ use log::info; use std::path::PathBuf; use testcontainers::{core::WaitFor, Image, ImageArgs, RunnableImage}; +/// Namenode Port pub const PORT_NAME_NODE: u16 = 9000; +/// Namenode HTTP Port pub const PORT_NAME_NODE_HTTP: u16 = 8020; const PORT_DATA_N0DE_0: u16 = 50010; @@ -26,7 +28,7 @@ pub struct MiniDFSBuilder { } impl MiniDFSBuilder { - /// Select tag for testcontainer image + /// Select tag for testcontainer pub fn with_tag(mut self, tag: &str) -> Self { self.tag = tag.to_string(); self