Skip to content

Commit 7c2d5d1

Browse files
authored
refactor(storage): Reorganize storage code into a new module (#2109)
## Which issue does this PR close? - Closes #. ## What changes are included in this PR? - Add a new module `storage` within `io` and put traits there ## Are these changes tested? Relying on the existing tests
1 parent 5cec0f3 commit 7c2d5d1

17 files changed

Lines changed: 22 additions & 23 deletions

File tree

crates/iceberg/src/io/file_io.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ use std::sync::Arc;
2323
use bytes::Bytes;
2424
use url::Url;
2525

26-
use super::opendal::OpenDalStorage;
27-
use super::storage::Storage;
26+
use super::storage::{OpenDalStorage, Storage};
2827
use crate::{Error, ErrorKind, Result};
2928

3029
/// FileIO implementation, used to manipulate files in underlying storage.

crates/iceberg/src/io/mod.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,11 @@
6666
//! - `new_input`: Create input file for reading.
6767
//! - `new_output`: Create output file for writing.
6868
69-
mod config;
7069
mod file_io;
71-
mod local_fs;
72-
mod memory;
73-
mod opendal;
7470
mod storage;
7571

76-
pub use config::*;
7772
pub use file_io::*;
78-
#[cfg(feature = "storage-s3")]
79-
pub use opendal::CustomAwsCredentialLoader;
80-
pub use opendal::{OpenDalStorage, OpenDalStorageFactory};
81-
pub use storage::{Storage, StorageConfig, StorageFactory};
73+
pub use storage::*;
8274

8375
pub(crate) mod object_cache;
8476

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use async_trait::async_trait;
3131
use bytes::Bytes;
3232
use serde::{Deserialize, Serialize};
3333

34-
use super::{
34+
use crate::io::{
3535
FileMetadata, FileRead, FileWrite, InputFile, OutputFile, Storage, StorageConfig,
3636
StorageFactory,
3737
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use async_trait::async_trait;
3030
use bytes::Bytes;
3131
use serde::{Deserialize, Serialize};
3232

33-
use super::{
33+
use crate::io::{
3434
FileMetadata, FileRead, FileWrite, InputFile, OutputFile, Storage, StorageConfig,
3535
StorageFactory,
3636
};
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,25 @@
1717

1818
//! Storage interfaces for Iceberg.
1919
20+
mod config;
21+
mod local_fs;
22+
mod memory;
23+
mod opendal;
24+
2025
use std::fmt::Debug;
2126
use std::sync::Arc;
2227

2328
use async_trait::async_trait;
2429
use bytes::Bytes;
30+
pub use config::*;
31+
pub use local_fs::{LocalFsStorage, LocalFsStorageFactory};
32+
pub use memory::{MemoryStorage, MemoryStorageFactory};
33+
#[cfg(feature = "storage-s3")]
34+
pub use opendal::CustomAwsCredentialLoader;
35+
pub use opendal::{OpenDalStorage, OpenDalStorageFactory};
2536

2637
use super::{FileMetadata, FileRead, FileWrite, InputFile, OutputFile};
2738
use crate::Result;
28-
pub use crate::io::config::StorageConfig;
2939

3040
/// Trait for storage operations in Iceberg.
3141
///

0 commit comments

Comments
 (0)