MCPcopy Create free account
hub / github.com/apache/arrow / DetectS3Backend

Function DetectS3Backend

cpp/src/arrow/filesystem/s3_internal.h:51–63  ·  view source on GitHub ↗

Detect the S3 backend type from the S3 server's response headers

Source from the content-addressed store, hash-verified

49
50// Detect the S3 backend type from the S3 server's response headers
51inline S3Backend DetectS3Backend(const Aws::Http::HeaderValueCollection& headers) {
52 const auto it = headers.find("server");
53 if (it != headers.end()) {
54 const auto& value = std::string_view(it->second);
55 if (value.find("AmazonS3") != std::string::npos) {
56 return S3Backend::Amazon;
57 }
58 if (value.find("MinIO") != std::string::npos) {
59 return S3Backend::Minio;
60 }
61 }
62 return S3Backend::Other;
63}
64
65template <typename Error>
66inline S3Backend DetectS3Backend(const Aws::Client::AWSError<Error>& error) {

Callers 1

GetOrSetBackendMethod · 0.85

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected