Class: OCI::ObjectStorage::Transfer::UploadManagerConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/object_storage/transfer/upload_manager_config.rb

Overview

A bag of configuration properties that can be used to configure UploadManager

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(allow_multipart: true, allow_parallel_multipart_uploads: true, parallel_process_count: OCI::ObjectStorage::Transfer::Multipart::DEFAULT_PARALLEL_PROCESS_COUNT, multipart_upload_threshold: OCI::ObjectStorage::Transfer::MULTIPART_UPLOAD_THRESHOLD, multipart_part_size: OCI::ObjectStorage::Transfer::MULTIPART_PART_SIZE, non_file_io_multipart_part_size: OCI::ObjectStorage::Transfer::NON_FILE_IO_MULTIPART_PART_SIZE) ⇒ UploadManagerConfig

Creates a new UploadManagerConfig.

Parameters:

  • allow_multipart (Boolean) (defaults to: true)

    Whether to allow multipart uploads or not. Defaults to true

  • allow_parallel_multipart_uploads (Boolean) (defaults to: true)

    For multipart uploads, whether we can upload parts in parallel. Defaults to true

  • parallel_process_count (Integer) (defaults to: OCI::ObjectStorage::Transfer::Multipart::DEFAULT_PARALLEL_PROCESS_COUNT)

    How many parts we can upload in parallel. Defaults to 3

  • multipart_upload_threshold (Integer) (defaults to: OCI::ObjectStorage::Transfer::MULTIPART_UPLOAD_THRESHOLD)

    The size, in bytes, which a file (or IO-like object) needs to exceed before we attempt a multipart upload. Defaults to 128 MiB

  • multipart_part_size (Integer) (defaults to: OCI::ObjectStorage::Transfer::MULTIPART_PART_SIZE)

    The size, in bytes, of each part of a multipart upload. This applies when we are uploading files from disk and defaults to 128 MiB

  • non_file_io_multipart_part_size (Integer) (defaults to: OCI::ObjectStorage::Transfer::NON_FILE_IO_MULTIPART_PART_SIZE)

    The size, in bytes, of each part of a multipart upload when we are reading from stdin or a non-file IO-like source (e.g. a StringIO). Defaults to 10 MiB



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/oci/object_storage/transfer/upload_manager_config.rb', line 45

def initialize(allow_multipart: true,
               allow_parallel_multipart_uploads: true,
               parallel_process_count: OCI::ObjectStorage::Transfer::Multipart::DEFAULT_PARALLEL_PROCESS_COUNT,
               multipart_upload_threshold: OCI::ObjectStorage::Transfer::MULTIPART_UPLOAD_THRESHOLD,
               multipart_part_size: OCI::ObjectStorage::Transfer::MULTIPART_PART_SIZE,
               non_file_io_multipart_part_size: OCI::ObjectStorage::Transfer::NON_FILE_IO_MULTIPART_PART_SIZE)
  @allow_multipart = allow_multipart
  @allow_parallel_multipart_uploads = allow_parallel_multipart_uploads
  @parallel_process_count = parallel_process_count
  @multipart_upload_threshold = multipart_upload_threshold
  @multipart_part_size = multipart_part_size
  @non_file_io_multipart_part_size = non_file_io_multipart_part_size
end

Instance Attribute Details

#allow_multipartBoolean

Whether to allow multipart uploads or not. Defaults to true

Returns:

  • (Boolean)


11
12
13
# File 'lib/oci/object_storage/transfer/upload_manager_config.rb', line 11

def allow_multipart
  @allow_multipart
end

#allow_parallel_multipart_uploadsBoolean

For multipart uploads, whether we can upload parts in parallel. Defaults to true

Returns:

  • (Boolean)


15
16
17
# File 'lib/oci/object_storage/transfer/upload_manager_config.rb', line 15

def allow_parallel_multipart_uploads
  @allow_parallel_multipart_uploads
end

#multipart_part_sizeInteger

The size, in bytes, of each part of a multipart upload. This applies when we are uploading files from disk and defaults to 128 MiB

Returns:

  • (Integer)


30
31
32
# File 'lib/oci/object_storage/transfer/upload_manager_config.rb', line 30

def multipart_part_size
  @multipart_part_size
end

#multipart_upload_thresholdInteger

The size, in bytes, which a file (or IO-like object) needs to exceed before we attempt a multipart upload. Defaults to 128 MiB (128 * 1024 * 1024 bytes)

Returns:

  • (Integer)


25
26
27
# File 'lib/oci/object_storage/transfer/upload_manager_config.rb', line 25

def multipart_upload_threshold
  @multipart_upload_threshold
end

#non_file_io_multipart_part_sizeInteger

The size, in bytes, of each part of a multipart upload when we are reading from stdin or a non-file IO-like source (e.g. a StringIO). Defaults to 10 MiB

Returns:

  • (Integer)


35
36
37
# File 'lib/oci/object_storage/transfer/upload_manager_config.rb', line 35

def non_file_io_multipart_part_size
  @non_file_io_multipart_part_size
end

#parallel_process_countInteger

How many parts we can upload in parallel. Defaults to 3. If this is set to 1, this is the equivalent of not allowing parts to be uploaded in parallel.

Returns:

  • (Integer)


20
21
22
# File 'lib/oci/object_storage/transfer/upload_manager_config.rb', line 20

def parallel_process_count
  @parallel_process_count
end