-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move upload code to transferer #39
base: master
Are you sure you want to change the base?
Conversation
b2sdk/bucket.py
Outdated
|
||
# Check for unfinished files with same name | ||
unfinished_file, finished_parts = self._find_unfinished_file_if_possible( | ||
return self.api.transferer.upload( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part size lines above this should also live in transferer, not Bucket
b2sdk/transferer/transferer.py
Outdated
logger = logging.getLogger(__name__) | ||
|
||
|
||
class LargeFileUploadState(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
separate file
b2sdk/transferer/transferer.py
Outdated
self.file_progress_listener.bytes_completed(self.bytes_completed) | ||
|
||
|
||
class PartProgressReporter(AbstractProgressListener): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
separate file
b2sdk/transferer/transferer.py
Outdated
@@ -58,6 +173,15 @@ def __init__(self, session, account_info): | |||
max_chunk_size=self.MAX_CHUNK_SIZE, | |||
), | |||
] | |||
self.upload_executor = None | |||
|
|||
def get_thread_pool(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should actually be a property and the field should be private. Also, it should live in Emerger - transferer should not be managing upload threads directly
b2sdk/transferer/transferer.py
Outdated
# so that they share resources during a sync. | ||
f = self.get_thread_pool().submit( | ||
self._upload_small_file, bucket_id, upload_source, file_name, content_type, file_info, | ||
progress_listener |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add trailing comma please
b2sdk/transferer/transferer.py
Outdated
part_range, | ||
upload_source, | ||
large_file_upload_state, | ||
finished_parts=None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing comma
5f0ecba
to
218bee6
Compare
* Transferer download logic to DownloadManager * Transferer upload logic to UploadManager * Draft implementation for CopyManager * Draft implementation for Emerger * Refactor B2Session to explicit interface * Move account_info, cache, raw_api to B2Session * Move large file helpers to LargeFileServices * Add missing abstract methods to AbstractRawApi * Remove unused parameters in raw api previously required by removed B2Sesion magic
No description provided.