Skip to content

Commit 5d07594

Browse files
authored
feat(io): Rename Storage to OpenDalStorage (#2059)
## Which issue does this PR close? - Closes #2052 ## What changes are included in this PR? - Rename Storage to OpenDalStorage so we can introduce Storage trait later ## Are these changes tested? Relies on existing tests
1 parent 05651e2 commit 5d07594

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

crates/iceberg/src/io/file_io.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use bytes::Bytes;
2424
use opendal::Operator;
2525
use url::Url;
2626

27-
use super::storage::Storage;
27+
use super::storage::OpenDalStorage;
2828
use crate::{Error, ErrorKind, Result};
2929

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

51-
inner: Arc<Storage>,
51+
inner: Arc<OpenDalStorage>,
5252
}
5353

5454
impl FileIO {
@@ -262,7 +262,7 @@ impl FileIOBuilder {
262262

263263
/// Builds [`FileIO`].
264264
pub fn build(self) -> Result<FileIO> {
265-
let storage = Storage::build(self.clone())?;
265+
let storage = OpenDalStorage::build(self.clone())?;
266266
Ok(FileIO {
267267
builder: self,
268268
inner: Arc::new(storage),

crates/iceberg/src/io/storage.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use crate::{Error, ErrorKind};
4343

4444
/// The storage carries all supported storage services in iceberg
4545
#[derive(Debug)]
46-
pub(crate) enum Storage {
46+
pub(crate) enum OpenDalStorage {
4747
#[cfg(feature = "storage-memory")]
4848
Memory(Operator),
4949
#[cfg(feature = "storage-fs")]
@@ -73,7 +73,7 @@ pub(crate) enum Storage {
7373
},
7474
}
7575

76-
impl Storage {
76+
impl OpenDalStorage {
7777
/// Convert iceberg config to opendal config.
7878
pub(crate) fn build(file_io_builder: FileIOBuilder) -> crate::Result<Self> {
7979
let (scheme_str, props, extensions) = file_io_builder.into_parts();
@@ -137,15 +137,15 @@ impl Storage {
137137
let _ = path;
138138
let (operator, relative_path): (Operator, &str) = match self {
139139
#[cfg(feature = "storage-memory")]
140-
Storage::Memory(op) => {
140+
OpenDalStorage::Memory(op) => {
141141
if let Some(stripped) = path.strip_prefix("memory:/") {
142142
Ok::<_, crate::Error>((op.clone(), stripped))
143143
} else {
144144
Ok::<_, crate::Error>((op.clone(), &path[1..]))
145145
}
146146
}
147147
#[cfg(feature = "storage-fs")]
148-
Storage::LocalFs => {
148+
OpenDalStorage::LocalFs => {
149149
let op = super::fs_config_build()?;
150150

151151
if let Some(stripped) = path.strip_prefix("file:/") {
@@ -155,7 +155,7 @@ impl Storage {
155155
}
156156
}
157157
#[cfg(feature = "storage-s3")]
158-
Storage::S3 {
158+
OpenDalStorage::S3 {
159159
configured_scheme,
160160
config,
161161
customized_credential_load,
@@ -175,7 +175,7 @@ impl Storage {
175175
}
176176
}
177177
#[cfg(feature = "storage-gcs")]
178-
Storage::Gcs { config } => {
178+
OpenDalStorage::Gcs { config } => {
179179
let operator = super::gcs_config_build(config, path)?;
180180
let prefix = format!("gs://{}/", operator.info().name());
181181
if path.starts_with(&prefix) {
@@ -188,7 +188,7 @@ impl Storage {
188188
}
189189
}
190190
#[cfg(feature = "storage-oss")]
191-
Storage::Oss { config } => {
191+
OpenDalStorage::Oss { config } => {
192192
let op = super::oss_config_build(config, path)?;
193193

194194
// Check prefix of oss path.
@@ -203,7 +203,7 @@ impl Storage {
203203
}
204204
}
205205
#[cfg(feature = "storage-azdls")]
206-
Storage::Azdls {
206+
OpenDalStorage::Azdls {
207207
configured_scheme,
208208
config,
209209
} => super::azdls_create_operator(path, config, configured_scheme),

0 commit comments

Comments
 (0)