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

Method CopyObject

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

Source from the content-addressed store, hash-verified

2392 }
2393
2394 Status CopyObject(const S3Path& src_path, const S3Path& dest_path) {
2395 ARROW_ASSIGN_OR_RAISE(auto client_lock, holder_->Lock());
2396
2397 S3Model::CopyObjectRequest req;
2398 req.SetBucket(ToAwsString(dest_path.bucket));
2399 req.SetKey(ToAwsString(dest_path.key));
2400 ARROW_ASSIGN_OR_RAISE(auto maybe_sse_headers,
2401 internal::GetSSECustomerKeyHeaders(options().sse_customer_key));
2402 if (maybe_sse_headers.has_value()) {
2403 auto sse_headers = std::move(maybe_sse_headers).value();
2404 req.SetSSECustomerKey(sse_headers.sse_customer_key);
2405 req.SetSSECustomerKeyMD5(sse_headers.sse_customer_key_md5);
2406 req.SetSSECustomerAlgorithm(sse_headers.sse_customer_algorithm);
2407 req.SetCopySourceSSECustomerKey(sse_headers.sse_customer_key);
2408 req.SetCopySourceSSECustomerKeyMD5(sse_headers.sse_customer_key_md5);
2409 req.SetCopySourceSSECustomerAlgorithm(sse_headers.sse_customer_algorithm);
2410 }
2411 req.SetCopySource(src_path.ToAwsString());
2412 return OutcomeToStatus(
2413 std::forward_as_tuple("When copying key '", src_path.key, "' in bucket '",
2414 src_path.bucket, "' to key '", dest_path.key,
2415 "' in bucket '", dest_path.bucket, "': "),
2416 "CopyObject", client_lock.Move()->CopyObject(req));
2417 }
2418
2419 // On Minio, an empty "directory" doesn't satisfy the same API requests as
2420 // a non-empty "directory". This is a Minio-specific quirk, but we need

Callers 2

MoveMethod · 0.80
CopyFileMethod · 0.80

Calls 5

ToAwsStringFunction · 0.85
OutcomeToStatusFunction · 0.85
ToAwsStringMethod · 0.80
valueMethod · 0.45
MoveMethod · 0.45

Tested by

no test coverage detected