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

Method ResolveRegion

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

Source from the content-addressed store, hash-verified

1205 }
1206
1207 Result<std::string> ResolveRegion(const std::string& bucket) {
1208 std::unique_lock<std::mutex> lock(cache_mutex_);
1209 auto it = cache_.find(bucket);
1210 if (it != cache_.end()) {
1211 return it->second;
1212 }
1213 // Cache miss: do the actual region lookup
1214 lock.unlock();
1215 ARROW_ASSIGN_OR_RAISE(auto region, ResolveRegionUncached(bucket));
1216 lock.lock();
1217 // Note we don't cache a nonexistent bucket, as the bucket could be created later
1218 cache_[bucket] = region;
1219 return region;
1220 }
1221
1222 Result<std::string> ResolveRegionUncached(const std::string& bucket) {
1223 ARROW_ASSIGN_OR_RAISE(auto client_lock, holder_->Lock());

Callers 1

ResolveS3BucketRegionFunction · 0.80

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected