Current File : //usr/lib/python3/dist-packages/s3transfer/__pycache__/manager.cpython-312.pyc |
�
�<�e[o � �0 � d dl Z d dlZd dlZd dlZd dlmZmZ d dlmZm Z m
Z
d dlmZ d dl
mZ d dlmZ d dlmZmZ d dlmZmZmZmZmZmZ d d lmZ d d
lmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z% ejL e'� Z( G d� d� Z) G d
� d� Z* G d� d� Z+y)� N)�BandwidthLimiter�LeakyBucket)�ALLOWED_DOWNLOAD_ARGS�KB�MB)�CopySubmissionTask)�DeleteSubmissionTask)�DownloadSubmissionTask)�CancelledError�
FatalError)�IN_MEMORY_DOWNLOAD_TAG�IN_MEMORY_UPLOAD_TAG�BoundedExecutor�TransferCoordinator�TransferFuture�TransferMeta)�UploadSubmissionTask)�CallArgs�OSUtils�SlidingWindowSemaphore�
TaskSemaphore�add_s3express_defaults�
get_callbacks�signal_not_transferring�signal_transferringc �D � e Zd Zdez dez ddddddez ddddfd�Zd� Zy) �TransferConfig� �
� i� � Nc
�� � || _ || _ || _ || _ || _ || _ || _ || _ | | _ |
| _ || _
|| _ | j � y)as Configurations for the transfer manager
:param multipart_threshold: The threshold for which multipart
transfers occur.
:param max_request_concurrency: The maximum number of S3 API
transfer-related requests that can happen at a time.
:param max_submission_concurrency: The maximum number of threads
processing a call to a TransferManager method. Processing a
call usually entails determining which S3 API requests that need
to be enqueued, but does **not** entail making any of the
S3 API data transferring requests needed to perform the transfer.
The threads controlled by ``max_request_concurrency`` is
responsible for that.
:param multipart_chunksize: The size of each transfer if a request
becomes a multipart transfer.
:param max_request_queue_size: The maximum amount of S3 API requests
that can be queued at a time.
:param max_submission_queue_size: The maximum amount of
TransferManager method calls that can be queued at a time.
:param max_io_queue_size: The maximum amount of read parts that
can be queued to be written to disk per download. The default
size for each elementin this queue is 8 KB.
:param io_chunksize: The max size of each chunk in the io queue.
Currently, this is size used when reading from the downloaded
stream as well.
:param num_download_attempts: The number of download attempts that
will be tried upon errors with downloading an object in S3. Note
that these retries account for errors that occur when streaming
down the data from s3 (i.e. socket errors and read timeouts that
occur after receiving an OK response from s3).
Other retryable exceptions such as throttling errors and 5xx errors
are already retried by botocore (this default is 5). The
``num_download_attempts`` does not take into account the
number of exceptions retried by botocore.
:param max_in_memory_upload_chunks: The number of chunks that can
be stored in memory at a time for all ongoing upload requests.
This pertains to chunks of data that need to be stored in memory
during an upload if the data is sourced from a file-like object.
The total maximum memory footprint due to a in-memory upload
chunks is roughly equal to:
max_in_memory_upload_chunks * multipart_chunksize
+ max_submission_concurrency * multipart_chunksize
``max_submission_concurrency`` has an affect on this value because
for each thread pulling data off of a file-like object, they may
be waiting with a single read chunk to be submitted for upload
because the ``max_in_memory_upload_chunks`` value has been reached
by the threads making the upload request.
:param max_in_memory_download_chunks: The number of chunks that can
be buffered in memory and **not** in the io queue at a time for all
ongoing download requests. This pertains specifically to file-like
objects that cannot be seeked. The total maximum memory footprint
due to a in-memory download chunks is roughly equal to:
max_in_memory_download_chunks * multipart_chunksize
:param max_bandwidth: The maximum bandwidth that will be consumed
in uploading and downloading file content. The value is in terms of
bytes per second.
N)
�multipart_threshold�multipart_chunksize�max_request_concurrency�max_submission_concurrency�max_request_queue_size�max_submission_queue_size�max_io_queue_size�io_chunksize�num_download_attempts�max_in_memory_upload_chunks�max_in_memory_download_chunks�
max_bandwidth�_validate_attrs_are_nonzero)
�selfr# r$ r% r&