Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add azdfs support #1009

Merged
merged 5 commits into from
Nov 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/service_test_azdfs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Service Test Azdfs

on:
push:
branches:
- main
pull_request:
branches:
- main
paths-ignore:
- "docs/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

jobs:
azure_azdfs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Test
shell: bash
run: cargo test azdfs --features compress -- --nocapture
env:
RUST_BACKTRACE: full
RUST_LOG: debug
OPENDAL_AZDFS_TEST: ${{ secrets.OPENDAL_AZDFS_TEST }}
OPENDAL_AZDFS_FILESYSTEM: ${{ secrets.OPENDAL_AZDFS_FILESYSTEM }}
OPENDAL_AZDFS_ENDPOINT: ${{ secrets.OPENDAL_AZDFS_ENDPOINT }}
OPENDAL_AZDFS_ACCOUNT_NAME: ${{ secrets.OPENDAL_AZDFS_ACCOUNT_NAME }}
OPENDAL_AZDFS_ACCOUNT_KEY: ${{ secrets.OPENDAL_AZDFS_ACCOUNT_KEY }}
1 change: 1 addition & 0 deletions src/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ impl Operator {
) -> Result<Self> {
let op = match scheme {
Scheme::Azblob => services::azblob::Builder::from_iter(it).build()?.into(),
Scheme::Azdfs => services::azdfs::Builder::from_iter(it).build()?.into(),
Scheme::Fs => services::fs::Builder::from_iter(it).build()?.into(),
#[cfg(feature = "services-ftp")]
Scheme::Ftp => services::ftp::Builder::from_iter(it).build()?.into(),
Expand Down
5 changes: 5 additions & 0 deletions src/scheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ use crate::Error;
pub enum Scheme {
/// [azblob][crate::services::azblob]: Azure Storage Blob services.
Azblob,
/// [azdls][crate::services::azdls]: Azure Data Lake Storage Gen2.
Azdfs,
/// [fs][crate::services::fs]: POSIX alike file system.
Fs,
/// [gcs][crate::services::gcs]: Google Cloud Storage backend.
Expand Down Expand Up @@ -90,6 +92,7 @@ impl Display for Scheme {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
Scheme::Azblob => write!(f, "azblob"),
Scheme::Azdfs => write!(f, "azdfs"),
Scheme::Fs => write!(f, "fs"),
#[cfg(feature = "services-hdfs")]
Scheme::Hdfs => write!(f, "hdfs"),
Expand Down Expand Up @@ -122,6 +125,7 @@ impl FromStr for Scheme {
let s = s.to_lowercase();
match s.as_str() {
"azblob" => Ok(Scheme::Azblob),
"azdfs" => Ok(Scheme::Azdfs),
"fs" => Ok(Scheme::Fs),
"gcs" => Ok(Scheme::Gcs),
#[cfg(feature = "services-hdfs")]
Expand Down Expand Up @@ -151,6 +155,7 @@ impl From<Scheme> for &'static str {
fn from(v: Scheme) -> Self {
match v {
Scheme::Azblob => "azblob",
Scheme::Azdfs => "azdfs",
Scheme::Fs => "fs",
Scheme::Gcs => "gcs",
#[cfg(feature = "services-hdfs")]
Expand Down
Loading