Skip to content

Commit

Permalink
Create separate objectstore crate (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimahriman authored Jan 5, 2024
1 parent 2c74bcb commit 64aa238
Show file tree
Hide file tree
Showing 72 changed files with 2,147 additions and 99 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/rust-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ jobs:
with:
toolchain: stable

- name: Publish to crates.io
- name: Publish hdfs-native to crates.io
run: cargo publish -p hdfs-native --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}

- name: Publish hdfs-native-objectstore to crates.io
run: cargo publish -p hdfs-native --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
11 changes: 2 additions & 9 deletions .github/workflows/rust-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ on:
branches:
- "*"

defaults:
run:
working-directory: ./rust

jobs:
format:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -62,11 +58,8 @@ jobs:
- name: Check token
run: cargo check --features token

- name: Check object_store
run: cargo check --features object_store

- name: Check all features
run: cargo check --features kerberos,token,object_store,integration-test
run: cargo check --features kerberos,token,integration-test

test:
strategy:
Expand Down Expand Up @@ -109,4 +102,4 @@ jobs:
echo "$GITHUB_WORKSPACE/hadoop-3.3.6/bin" >> $GITHUB_PATH
- name: Run tests
run: cargo test --features kerberos,token,object_store,integration-test
run: cargo test --features kerberos,token,integration-test
22 changes: 19 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
[workspace]
members = [
"rust",
"crates/*",
"python",
]
resolver = "2"

[workspace.dependencies]
bytes = "1"
futures = "0.3"
tokio = "1"
File renamed without changes.
32 changes: 32 additions & 0 deletions crates/hdfs-native-object-store/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "hdfs-native-object-store"
version = "0.5.0"
edition = "2021"
authors = ["Adam Binford <[email protected]>"]
homepage = "https://github.com/Kimahriman/hdfs-native"
repository = "https://github.com/Kimahriman/hdfs-native"
keywords = ["hadoop", "hdfs", "object_store"]
description = "object_store implementation for Native HDFS client"
readme = "../../README.md"
license = "Apache-2.0"

[dependencies]
async-trait = { version = "0.1" }
bytes = { workspace = true }
chrono = { version = "0.4" }
futures = { workspace = true }
hdfs-native = { path = "../hdfs-native", version = "0.5", features = ["token", "kerberos"] }
object_store = { version = "0.7", features = ["cloud"] }
thiserror = "1"
tokio = { workspace = true, features = ["rt", "net", "io-util", "macros", "sync", "time"] }

[dev-dependencies]
criterion = "0.5"
env_logger = "0.10"
serial_test = "2.0.0"
tempfile = "3"
which = "4"


[features]
integration-test = ["hdfs-native/integration-test"]
14 changes: 14 additions & 0 deletions crates/hdfs-native-object-store/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Object store implementation for the Native Rust HDFS client

## Usage

```rust
use hdfs_native::Client;
use hdfs_native_object_store::HdfsObjectStore;
use hdfs_native::Result;
fn main() -> Result<()> {
let client = Client::new("hdfs://localhost:9000")?;
let store = HdfsObjectStore::new(client);
Ok(())
}
```
File renamed without changes.
Loading

0 comments on commit 64aa238

Please sign in to comment.