Skip to content

Commit

Permalink
Renaming google flag to gcs. Fixing features flags. (#4361)
Browse files Browse the repository at this point in the history
  • Loading branch information
fulmicoton authored Jan 10, 2024
1 parent d47b6bd commit 374337d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions quickwit/quickwit-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ azure = [
"azure_storage/enable_reqwest_rustls",
"azure_storage_blobs/enable_reqwest_rustls",
]
google = [
gcs = [
"dep:opendal",
"opendal/services-gcs"
]
Expand All @@ -83,7 +83,7 @@ integration-testsuite = [
"azure",
"azure_core/azurite_workaround",
"azure_storage_blobs/azurite_workaround",
"google",
"gcs", # Stands for Google cloud storage.
"dep:reqsign",
"reqsign/services-google",
"dep:reqwest"
Expand Down
6 changes: 3 additions & 3 deletions quickwit/quickwit-storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ mod error;

mod local_file_storage;
mod object_storage;
#[cfg(feature = "google")]
#[cfg(feature = "gcs")]
mod opendal_storage;
mod payload;
mod prefix_storage;
Expand Down Expand Up @@ -74,9 +74,9 @@ pub use self::object_storage::{AzureBlobStorage, AzureBlobStorageFactory};
pub use self::object_storage::{
MultiPartPolicy, S3CompatibleObjectStorage, S3CompatibleObjectStorageFactory,
};
#[cfg(any(feature = "google", feature = "integration-testsuite"))]
#[cfg(all(feature = "gcs", feature = "integration-testsuite"))]
pub use self::opendal_storage::new_emulated_google_cloud_storage;
#[cfg(feature = "google")]
#[cfg(feature = "gcs")]
pub use self::opendal_storage::GoogleCloudStorageFactory;
pub use self::ram_storage::{RamStorage, RamStorageBuilder};
pub use self::split::{SplitPayload, SplitPayloadBuilder};
Expand Down
1 change: 1 addition & 0 deletions quickwit/quickwit-storage/src/opendal_storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ mod base;
use base::OpendalStorage;

mod google_cloud_storage;

#[cfg(feature = "integration-testsuite")]
pub use google_cloud_storage::new_emulated_google_cloud_storage;
pub use google_cloud_storage::GoogleCloudStorageFactory;
8 changes: 4 additions & 4 deletions quickwit/quickwit-storage/src/storage_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use crate::local_file_storage::LocalFileStorageFactory;
use crate::ram_storage::RamStorageFactory;
#[cfg(feature = "azure")]
use crate::AzureBlobStorageFactory;
#[cfg(feature = "google")]
#[cfg(feature = "gcs")]
use crate::GoogleCloudStorageFactory;
use crate::{S3CompatibleObjectStorageFactory, Storage, StorageFactory, StorageResolverError};

Expand Down Expand Up @@ -112,19 +112,19 @@ impl StorageResolver {
"Quickwit was compiled without the `azure` feature.",
))
}
#[cfg(feature = "google")]
#[cfg(feature = "gcs")]
{
builder = builder.register(GoogleCloudStorageFactory::new(
storage_configs.find_google().cloned().unwrap_or_default(),
));
}
#[cfg(not(feature = "google"))]
#[cfg(not(feature = "gcs"))]
{
use crate::storage_factory::UnsupportedStorage;

builder = builder.register(UnsupportedStorage::new(
StorageBackend::Google,
"Quickwit was compiled without the `google` feature.",
"Quickwit was compiled without the `gcs` feature.",
))
}
builder
Expand Down
2 changes: 1 addition & 1 deletion quickwit/quickwit-storage/tests/google_cloud_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// This file is an integration test that assumes that a connection
// to Fake GCS Server (the emulated google cloud storage environment)

#[cfg(feature = "integration-testsuite")]
#[cfg(all(feature = "integration-testsuite", feature = "gcs"))]
#[tokio::test]
#[cfg_attr(not(feature = "ci-test"), ignore)]
async fn google_cloud_storage_test_suite() -> anyhow::Result<()> {
Expand Down

0 comments on commit 374337d

Please sign in to comment.