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

Method MakeUri

cpp/src/arrow/filesystem/s3fs.cc:3051–3073  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3049}
3050
3051Result<std::string> S3FileSystem::MakeUri(std::string path) const {
3052 if (path.length() <= 1 || path[0] != '/') {
3053 return Status::Invalid("MakeUri requires an absolute, non-root path, got ", path);
3054 }
3055 ARROW_ASSIGN_OR_RAISE(auto uri, util::UriFromAbsolutePath(path));
3056 if (!options().GetAccessKey().empty()) {
3057 uri = "s3://" + options().GetAccessKey() + ":" + options().GetSecretKey() + "@" +
3058 uri.substr("file:///"s.size());
3059 } else {
3060 uri = "s3" + uri.substr("file"s.size());
3061 }
3062 uri += "?";
3063 uri += "region=" + util::UriEscape(options().region);
3064 uri += "&";
3065 uri += "scheme=" + util::UriEscape(options().scheme);
3066 uri += "&";
3067 uri += "endpoint_override=" + util::UriEscape(options().endpoint_override);
3068 uri += "&";
3069 uri += "allow_bucket_creation="s + (options().allow_bucket_creation ? "1" : "0");
3070 uri += "&";
3071 uri += "allow_bucket_deletion="s + (options().allow_bucket_deletion ? "1" : "0");
3072 return uri;
3073}
3074
3075S3Options S3FileSystem::options() const { return impl_->options(); }
3076

Callers 2

TYPED_TESTFunction · 0.45
TESTFunction · 0.45

Calls 9

optionsFunction · 0.85
UriEscapeFunction · 0.85
GetAccessKeyMethod · 0.80
GetSecretKeyMethod · 0.80
substrMethod · 0.80
InvalidFunction · 0.50
lengthMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by 2

TYPED_TESTFunction · 0.36
TESTFunction · 0.36