Class: Aws::S3::ObjectMultipartCopier Private
- Inherits:
-
Object
- Object
- Aws::S3::ObjectMultipartCopier
- Defined in:
- lib/aws-sdk-s3/object_multipart_copier.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Classes: PartQueue
Constant Summary collapse
- MIN_PART_SIZE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
rubocop:disable Metrics/ClassLength
5 * 1024 * 1024
- MAX_PARTS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
5MB
10_000- API_OPTIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
{ create_multipart_upload: Set.new(Client.api.operation(:create_multipart_upload).input.shape.member_names), upload_part_copy: Set.new(Client.api.operation(:upload_part_copy).input.shape.member_names), complete_multipart_upload: Set.new(Client.api.operation(:complete_multipart_upload).input.shape.member_names) }.freeze
Instance Attribute Summary collapse
- #client ⇒ Client readonly private
Instance Method Summary collapse
- #copy(options = {}) ⇒ Object private
-
#initialize(options = {}) ⇒ ObjectMultipartCopier
constructor
private
A new instance of ObjectMultipartCopier.
Constructor Details
#initialize(options = {}) ⇒ ObjectMultipartCopier
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ObjectMultipartCopier.
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/aws-sdk-s3/object_multipart_copier.rb', line 31 def initialize( = {}) @use_source_parts = .delete(:use_source_parts) || false @thread_count = .delete(:thread_count) || 10 @min_part_size = .delete(:min_part_size) || (MIN_PART_SIZE * 10) @client = [:client] || Client.new @source_client = nil @source = nil @source_etag = nil @source_parts_count = nil @first_part_size = nil end |
Instance Attribute Details
#client ⇒ Client (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
44 45 46 |
# File 'lib/aws-sdk-s3/object_multipart_copier.rb', line 44 def client @client end |
Instance Method Details
#copy(options = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/aws-sdk-s3/object_multipart_copier.rb', line 47 def copy( = {}) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength @source_client = [:copy_source_client] || @client @source = resolve_source([:copy_source]) = () size = [:content_length] @source_etag = [:etag] @source[:version_id] ||= [:version_id] resolve_source_parts tag_set = () annotations = resolve_annotations() create_opts = resolve_create_opts(, ) [:upload_id] = initiate_upload(create_opts) begin parts = copy_parts(size, default_part_size(size), ) resp = complete_upload(parts, ) rescue StandardError => e abort_upload() raise e end (tag_set, resp, ) if tag_set put_annotations(annotations, resp, ) if annotations&.any? end |