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 hdfs scheme #266

Merged
merged 2 commits into from
May 9, 2022
Merged
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
12 changes: 6 additions & 6 deletions src/scheme.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::io;
// Copyright 2022 Datafuse Labs.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -12,6 +11,7 @@ use std::io;
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use std::io;
use std::str::FromStr;

use anyhow::anyhow;
Expand All @@ -26,6 +26,9 @@ pub enum Scheme {
Azblob,
/// [fs][crate::services::fs]: POSIX alike file system.
Fs,
/// [hdfs][crate::services::hdfs]: Hadoop Distributed File System.
#[cfg(feature = "services-hdfs")]
Hdfs,
/// [memory][crate::services::memory]: In memory backend support.
Memory,
/// [s3][crate::services::s3]: AWS S3 alike services.
Expand All @@ -40,13 +43,10 @@ impl FromStr for Scheme {
match s.as_str() {
"azblob" => Ok(Scheme::Azblob),
"fs" => Ok(Scheme::Fs),
#[cfg(feature = "services-hdfs")]
"hdfs" => Ok(Scheme::Hdfs),
"memory" => Ok(Scheme::Memory),
"s3" => Ok(Scheme::S3),

// TODO: it's used for compatibility with dal1, should be removed in the future
"local" | "disk" => Ok(Scheme::Fs),
"azurestorageblob" => Ok(Scheme::Azblob),

v => Err(other(BackendError::new(
Default::default(),
anyhow!("{} is not supported", v),
Expand Down