Skip to content

Comments

feat(services/s3): Add detect_region support for S3Builder#2634

Merged
Xuanwo merged 3 commits intoapache:mainfrom
parkma99:detect_region
Jul 14, 2023
Merged

feat(services/s3): Add detect_region support for S3Builder#2634
Xuanwo merged 3 commits intoapache:mainfrom
parkma99:detect_region

Conversation

@parkma99
Copy link
Contributor

close #2632

I am newer for OpenDAL and this is my first PR for OpenDAL.

Now the test case for detect_region is not added.

I am confusing how to build a S3Builder with custom region, default is None, and use region(str) function needs the S3Builder has a custom region.

BTW, how check Error in test case, I try use assert_eq!() for check Error, it failed.

Thanks for helping.

@Xuanwo
Copy link
Member

Xuanwo commented Jul 13, 2023

Thanks for the PR! Let me make the feature request more clear.

As described in the issue, I want an API of S3Builder like async fn detect_region(&self) -> Result<Option<String>>, it's used to fetch region with input endpoint and bucket. (Maybe API should be async fn detect_region(&self, endpoint: &str, bucket: &str)?)

The API should use the client in S3Builder to detect the region, the behavior will be similiar to

https://github.com/apache/incubator-opendal/blob/44e93563227e58520f07e0ebcf3be14601b59d9a/src/services/s3/backend.rs#L504-L604

The caller can use this function to detect region when they needed in async context. (Please note that S3Builder::build is blocking API, so we can't do this.)


Also updated the issue.

@Xuanwo Xuanwo mentioned this pull request Jul 14, 2023
@Xuanwo Xuanwo changed the title add detect_region code for S3Builder feat(services/s3): Add detect_region support for S3Builder Jul 14, 2023
@github-actions github-actions bot added the releases-note/feat The PR implements a new feature or has a title that begins with "feat" label Jul 14, 2023
Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Great, thanks a lot!

@Xuanwo Xuanwo marked this pull request as ready for review July 14, 2023 12:46
@Xuanwo Xuanwo merged commit 099458f into apache:main Jul 14, 2023
ClSlaid added a commit to ClSlaid/opendal that referenced this pull request Jul 14, 2023
Xuanwo pushed a commit that referenced this pull request Jul 14, 2023
* Bump to version 0.38.1

* feat(binding/lua): add rename and create_dir operator function by @oowl in #2564
* feat(services/azblob): support sink by @suyanhanx in #2574
* feat(services/gcs): support sink by @suyanhanx in #2576
* feat(services/oss): support sink by @suyanhanx in #2577
* feat(services/obs): support sink by @suyanhanx in #2578
* feat(services/cos): impl sink by @suyanhanx in #2587
* feat(service): Support stat for Dropbox by @Zheaoli in #2588
* feat(services/dropbox): impl create_dir and polish error handling by @suyanhanx in #2600
* feat(services/dropbox): Implement refresh token support by @Xuanwo in #2604
* feat(service/dropbox): impl batch delete by @suyanhanx in #2606
* feat(CI): set Kvrocks test for service redis by @suyanhanx in #2613
* feat(core): object versioning APIs by @suyanhanx in #2614
* feat(oay): actually read configuration from `oay.toml` by @messense in #2615
* feat(services/webdav): impl sink by @suyanhanx in #2622
* feat(services/fs): impl Sink for Fs by @Ji-Xinyou in #2626
* feat(core): impl `delete_with` on blocking operator by @suyanhanx in #2633
* feat(bindings/C): add support for list in C binding by @Ji-Xinyou in #2448
* refactor(core): Add ErrorKind InvalidInput to indicate users input error by @dqhl76 in #2637
* fix(doc): fix codeblock rendering by @xxchan in #2592
* fix(service/minitrace): should set local parent by @andylokandy in #2620
* fix(service/minitrace): update doc by @andylokandy in #2621
* doc(bindings/haskell): add module document by @silver-ymz in #2566
* docs: Update license related comments by @Prashanth-Chandra in #2573
* docs: add hdfs namenode High Availability related troubleshoot by @wcy-fdu in #2601
* docs: polish release doc by @PsiACE in #2608
* docs(blog): add Apache OpenDAL(Incubating): Access Data Freely by @PsiACE in #2607
* docs(RFC): Object Versioning by @suyanhanx in #2602
* ci: Disable bindings/java deploy for now by @tisonkun in #2560
* ci: Disable the failed stage-release job instead by @tisonkun in #2561
* ci: add haddock generator for haskell binding by @silver-ymz in #2569
* ci(binding/lua): add luarocks package manager support by @oowl in #2558
* build(deps): bump predicates from 2.1.5 to 3.0.1 by @dependabot in #2583
* build(deps): bump tower-http from 0.4.0 to 0.4.1 by @dependabot in #2582
* build(deps): bump chrono from 0.4.24 to 0.4.26 by @dependabot in #2581
* build(deps): bump redis from 0.22.3 to 0.23.0 by @dependabot in #2580
* build(deps): bump cbindgen from 0.24.3 to 0.24.5 by @dependabot in #2579
* ci: upgrade hawkeye to v3 by @tisonkun in #2585
* ci(services/webdav): Setup integration test for nextcloud by @Xuanwo in #2631
* chore: add haskell binding link to website by @silver-ymz in #2571
* chore: fix cargo warning for resolver by @xxchan in #2590
* chore: bump log to 0.4.19 by @xxchan in #2591
* chore(deps): update deps to latest version by @suyanhanx in #2596
* chore: Add release 0.38.0 to download by @PsiACE in #2597
* chore(service/minitrace): automatically generate span name by @andylokandy in #2618

* @Prashanth-Chandra made their first contribution in #2573
* @andylokandy made their first contribution in #2618

**Full Changelog**: v0.38.0...v0.38.1

Signed-off-by: ClSlaid <[email protected]>

* refactor: bump npm version

Signed-off-by: ClSlaid <[email protected]>

* chore: include #2634

Signed-off-by: 蔡略 <[email protected]>

---------

Signed-off-by: ClSlaid <[email protected]>
Signed-off-by: 蔡略 <[email protected]>
@parkma99 parkma99 deleted the detect_region branch July 15, 2023 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/feat The PR implements a new feature or has a title that begins with "feat"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

services/s3: Add helper function in S3Builder to detect region

2 participants