Skip to content
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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

move upload code to transferer #39

wants to merge 8 commits into from

Conversation

anuj-reef
Copy link

No description provided.

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(

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

logger = logging.getLogger(__name__)


class LargeFileUploadState(object):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separate file

self.file_progress_listener.bytes_completed(self.bytes_completed)


class PartProgressReporter(AbstractProgressListener):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separate file

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

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

# 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add trailing comma please

part_range,
upload_source,
large_file_upload_state,
finished_parts=None

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing comma

anuj-reef and others added 7 commits November 25, 2019 12:56
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants