Skip to content

Commit

Permalink
apacheGH-38844: [C++] S3FileSystem export s3 sdk config "use_virtual_…
Browse files Browse the repository at this point in the history
…addressing" to arrow::fs::S3Options (apache#38858)

### Rationale for this change
See apache#38844 . we should export s3 sdk config "use_virtual_addressing" to arrow::fs::S3Options so that user can decide whether to use virtual hosted by themselves. 

### Are these changes tested?
I tested it with my own OSS(aliyun object store service) bucket.As the it is a S3 compatiable service, I think 
 these changes are covered by existing tests)

### Are there any user-facing changes?

Closes: apache#38844  

* Closes: apache#38844

Lead-authored-by: ljw <[email protected]>
Co-authored-by: Antoine Pitrou <[email protected]>
Co-authored-by: jiawei liang <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
  • Loading branch information
2 people authored and dgreiss committed Feb 17, 2024
1 parent b06b52f commit 453aee4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpp/src/arrow/filesystem/s3fs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,8 @@ class ClientBuilder {
client_config_.caPath = ToAwsString(internal::global_options.tls_ca_dir_path);
}

const bool use_virtual_addressing = options_.endpoint_override.empty();
const bool use_virtual_addressing =
options_.endpoint_override.empty() || options_.force_virtual_addressing;

// Set proxy options if provided
if (!options_.proxy_options.scheme.empty()) {
Expand Down
8 changes: 8 additions & 0 deletions cpp/src/arrow/filesystem/s3fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ struct ARROW_EXPORT S3Options {
/// Type of credentials being used. Set along with credentials_provider.
S3CredentialsKind credentials_kind = S3CredentialsKind::Default;

/// Whether to use virtual addressing of buckets
///
/// If true, then virtual addressing is always enabled.
/// If false, then virtual addressing is only enabled if `endpoint_override` is empty.
///
/// This can be used for non-AWS backends that only support virtual hosted-style access.
bool force_virtual_addressing = false;

/// Whether OutputStream writes will be issued in the background, without blocking.
bool background_writes = true;

Expand Down

0 comments on commit 453aee4

Please sign in to comment.