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

Add Builder style config objects for object_store #2204

Merged
merged 4 commits into from
Jul 29, 2022

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Jul 27, 2022

Which issue does this PR close?

Closes #2203

Rationale for this change

Current config is both a pain to use as well as will require backwards incompatible changes to extend (e.g. add a new parameter)

What changes are included in this PR?

Add builder style configs:

  • AmazonS3Builder
  • MicrosoftAzureBuilder
  • GoogleCloudStorageBuilder

Are there any user-facing changes?

Yes, the configuration system is better

@github-actions github-actions bot added the object-store Object Store Interface label Jul 27, 2022
@alamb alamb force-pushed the alamb/object_store_config branch from 6725394 to b3c9771 Compare July 28, 2022 12:21
Copy link
Contributor Author

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the diffs in this PR are easier to understand with whitespace blind diff https://github.com/apache/arrow-rs/pull/2204/files?w=1

true,
)
}
// /// Create a new [`AmazonS3`] that always errors
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what this is used for -- I think perhaps we should remove it. Maybe @tustvold or @carols10cents
remembers what it is for ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I seem to remember IOx used it for failing tests, now that ObjectStore is object-safe I'm fairly confident it can go

@@ -1067,17 +1185,9 @@ mod tests {

const NON_EXISTENT_NAME: &str = "nonexistentname";

#[derive(Debug)]
struct AwsConfig {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amusingly (at least to me) the tests had created a partial config struct anyways -- so this PR can be thought of "exposing these configuration options to uers" 😆

pub struct MicrosoftAzureBuilder {
account: Option<String>,
access_key: Option<String>,
container_name: Option<String>,
Copy link
Contributor Author

@alamb alamb Jul 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if I should also call this bucket_name (generic term) or container_name (Azure specific term). I kept the existing naming convention

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should match the convention for Azure, i.e. container_name

@alamb alamb marked this pull request as ready for review July 28, 2022 17:37
@alamb alamb requested a review from tustvold July 29, 2022 12:44
true,
)
}
// /// Create a new [`AmazonS3`] that always errors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I seem to remember IOx used it for failing tests, now that ObjectStore is object-safe I'm fairly confident it can go

pub struct MicrosoftAzureBuilder {
account: Option<String>,
access_key: Option<String>,
container_name: Option<String>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should match the convention for Azure, i.e. container_name

///
/// This allows you to set custom client options such as allowing
/// non secure connections or custom headers.
pub fn with_client(mut self, client: Client) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should keep this pub(crate) at least for now, in case we want to change the client down the line or something...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is only in test I will make it #[cfg(test)] and we can always make it pub later

@alamb alamb changed the title Add Builder style config objects Add Builder style config objects for object_store Jul 29, 2022
@alamb alamb merged commit 41d96b2 into apache:master Jul 29, 2022
@ursabot
Copy link

ursabot commented Jul 29, 2022

Benchmark runs are scheduled for baseline = 393f006 and contender = 41d96b2. 41d96b2 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@tustvold tustvold mentioned this pull request Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
object-store Object Store Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

object_store: Make builder style configuration for object stores
3 participants