Skip to content
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
6 changes: 3 additions & 3 deletions crates/iceberg/src/io/file_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use bytes::Bytes;
use opendal::Operator;
use url::Url;

use super::storage::Storage;
use super::storage::OpenDalStorage;
use crate::{Error, ErrorKind, Result};

/// FileIO implementation, used to manipulate files in underlying storage.
Expand All @@ -48,7 +48,7 @@ use crate::{Error, ErrorKind, Result};
pub struct FileIO {
builder: FileIOBuilder,

inner: Arc<Storage>,
inner: Arc<OpenDalStorage>,
}

impl FileIO {
Expand Down Expand Up @@ -262,7 +262,7 @@ impl FileIOBuilder {

/// Builds [`FileIO`].
pub fn build(self) -> Result<FileIO> {
let storage = Storage::build(self.clone())?;
let storage = OpenDalStorage::build(self.clone())?;
Ok(FileIO {
builder: self,
inner: Arc::new(storage),
Expand Down
16 changes: 8 additions & 8 deletions crates/iceberg/src/io/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use crate::{Error, ErrorKind};

/// The storage carries all supported storage services in iceberg
#[derive(Debug)]
pub(crate) enum Storage {
pub(crate) enum OpenDalStorage {
#[cfg(feature = "storage-memory")]
Memory(Operator),
#[cfg(feature = "storage-fs")]
Expand Down Expand Up @@ -73,7 +73,7 @@ pub(crate) enum Storage {
},
}

impl Storage {
impl OpenDalStorage {
/// Convert iceberg config to opendal config.
pub(crate) fn build(file_io_builder: FileIOBuilder) -> crate::Result<Self> {
let (scheme_str, props, extensions) = file_io_builder.into_parts();
Expand Down Expand Up @@ -137,15 +137,15 @@ impl Storage {
let _ = path;
let (operator, relative_path): (Operator, &str) = match self {
#[cfg(feature = "storage-memory")]
Storage::Memory(op) => {
OpenDalStorage::Memory(op) => {
if let Some(stripped) = path.strip_prefix("memory:/") {
Ok::<_, crate::Error>((op.clone(), stripped))
} else {
Ok::<_, crate::Error>((op.clone(), &path[1..]))
}
}
#[cfg(feature = "storage-fs")]
Storage::LocalFs => {
OpenDalStorage::LocalFs => {
let op = super::fs_config_build()?;

if let Some(stripped) = path.strip_prefix("file:/") {
Expand All @@ -155,7 +155,7 @@ impl Storage {
}
}
#[cfg(feature = "storage-s3")]
Storage::S3 {
OpenDalStorage::S3 {
configured_scheme,
config,
customized_credential_load,
Expand All @@ -175,7 +175,7 @@ impl Storage {
}
}
#[cfg(feature = "storage-gcs")]
Storage::Gcs { config } => {
OpenDalStorage::Gcs { config } => {
let operator = super::gcs_config_build(config, path)?;
let prefix = format!("gs://{}/", operator.info().name());
if path.starts_with(&prefix) {
Expand All @@ -188,7 +188,7 @@ impl Storage {
}
}
#[cfg(feature = "storage-oss")]
Storage::Oss { config } => {
OpenDalStorage::Oss { config } => {
let op = super::oss_config_build(config, path)?;

// Check prefix of oss path.
Expand All @@ -203,7 +203,7 @@ impl Storage {
}
}
#[cfg(feature = "storage-azdls")]
Storage::Azdls {
OpenDalStorage::Azdls {
configured_scheme,
config,
} => super::azdls_create_operator(path, config, configured_scheme),
Expand Down
Loading