Class: Aws::S3::MultipartStreamUploader Private

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-sdk-s3/multipart_stream_uploader.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.

Constant Summary collapse

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.

api private

5 * 1024 * 1024
THREAD_COUNT =

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.

api private

10
TEMPFILE_PREIX =

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.

api private

'aws-sdk-s3-upload_stream'.freeze
CREATE_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.

Set.new(Client.api.operation(:create_multipart_upload).input.shape.member_names)
UPLOAD_PART_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.

Set.new(Client.api.operation(:upload_part).input.shape.member_names)
COMPLETE_UPLOAD_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.

Set.new(Client.api.operation(:complete_multipart_upload).input.shape.member_names)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ MultipartStreamUploader

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 MultipartStreamUploader.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):



34
35
36
37
38
39
# File 'lib/aws-sdk-s3/multipart_stream_uploader.rb', line 34

def initialize(options = {})
  @client = options[:client] || Client.new
  @tempfile = options[:tempfile]
  @part_size = options[:part_size] || PART_SIZE
  @thread_count = options[:thread_count] || THREAD_COUNT
end

Instance Attribute Details

#clientClient (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.

Returns:



42
43
44
# File 'lib/aws-sdk-s3/multipart_stream_uploader.rb', line 42

def client
  @client
end

Instance Method Details

#upload(options = {}, &block) ⇒ Seahorse::Client::Response

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 - the CompleteMultipartUploadResponse.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :bucket (required, String)
  • :key (required, String)
  • :thread_count (Integer) — default: THREAD_COUNT

Returns:

  • (Seahorse::Client::Response)
    • the CompleteMultipartUploadResponse



48
49
50
51
52
53
54
# File 'lib/aws-sdk-s3/multipart_stream_uploader.rb', line 48

def upload(options = {}, &block)
  Aws::Plugins::UserAgent.feature('s3-transfer') do
    upload_id = initiate_upload(options)
    parts = upload_parts(upload_id, options, &block)
    complete_upload(upload_id, parts, options)
  end
end