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

Method OpenOutputStream

cpp/src/arrow/filesystem/gcsfs.cc:617–637  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

615 }
616
617 Result<std::shared_ptr<GcsOutputStream>> OpenOutputStream(
618 const GcsPath& path, const std::shared_ptr<const KeyValueMetadata>& metadata) {
619 std::shared_ptr<const KeyValueMetadata> resolved_metadata = metadata;
620 if (resolved_metadata == nullptr && options_.default_metadata != nullptr) {
621 resolved_metadata = options_.default_metadata;
622 }
623 gcs::EncryptionKey encryption_key;
624 ARROW_ASSIGN_OR_RAISE(encryption_key, internal::ToEncryptionKey(resolved_metadata));
625 gcs::PredefinedAcl predefined_acl;
626 ARROW_ASSIGN_OR_RAISE(predefined_acl, internal::ToPredefinedAcl(resolved_metadata));
627 gcs::KmsKeyName kms_key_name;
628 ARROW_ASSIGN_OR_RAISE(kms_key_name, internal::ToKmsKeyName(resolved_metadata));
629 gcs::WithObjectMetadata with_object_metadata;
630 ARROW_ASSIGN_OR_RAISE(with_object_metadata,
631 internal::ToObjectMetadata(resolved_metadata));
632
633 auto stream = client_.WriteObject(path.bucket, path.object, encryption_key,
634 predefined_acl, kms_key_name, with_object_metadata);
635 ARROW_GCS_RETURN_NOT_OK(stream.last_status());
636 return std::make_shared<GcsOutputStream>(std::move(stream));
637 }
638
639 google::cloud::StatusOr<gcs::ObjectMetadata> GetObjectMetadata(const GcsPath& path) {
640 return client_.GetObjectMetadata(path.bucket, path.object);

Callers

nothing calls this directly

Calls 5

ToEncryptionKeyFunction · 0.85
ToPredefinedAclFunction · 0.85
ToKmsKeyNameFunction · 0.85
ToObjectMetadataFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.50

Tested by

no test coverage detected