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)

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):



28
29
30
31
32
33
# File 'lib/aws-sdk-s3/multipart_stream_uploader.rb', line 28

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:



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

def client
  @client
end

Instance Method Details

#upload(options = {}, &block) ⇒ void

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.

This method returns an undefined value.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :bucket (required, String)
  • :key (required, String)


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

def upload(options = {}, &block)
  upload_id = initiate_upload(options)
  parts = upload_parts(upload_id, options, &block)
  complete_upload(upload_id, parts, options)
end