MCPcopy Create free account
hub / github.com/apache/impala / Fetch

Method Fetch

be/src/kudu/util/cloud/instance_metadata.cc:166–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166Status InstanceMetadata::Fetch(const string& url,
167 MonoDelta timeout,
168 const vector<string>& headers,
169 string* out) {
170 if (timeout.ToMilliseconds() == 0) {
171 return Status::NotSupported(
172 "unlimited timeout is not supported when retrieving instance metadata");
173 }
174 EasyCurl curl;
175 curl.set_timeout(timeout);
176 curl.set_fail_on_http_error(true);
177
178 if (PREDICT_FALSE(!FLAGS_cloud_curl_dns_servers_for_testing.empty())) {
179 curl.set_dns_servers(FLAGS_cloud_curl_dns_servers_for_testing);
180 }
181
182 faststring resp;
183 RETURN_NOT_OK(curl.FetchURL(url, &resp, headers));
184 if (out) {
185 *out = resp.ToString();
186 }
187 return Status::OK();
188}
189
190Status AwsInstanceMetadata::Init() {
191 // Try if the metadata server speaks AWS API.

Callers

nothing calls this directly

Calls 9

NotSupportedFunction · 0.85
OKFunction · 0.85
ToMillisecondsMethod · 0.80
set_dns_serversMethod · 0.80
FetchURLMethod · 0.80
set_timeoutMethod · 0.45
emptyMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected