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

Design flaws of StorageManager #586

Open
6 tasks
jennydaman opened this issue Oct 7, 2024 · 1 comment
Open
6 tasks

Design flaws of StorageManager #586

jennydaman opened this issue Oct 7, 2024 · 1 comment

Comments

@jennydaman
Copy link
Contributor

The StorageManager's methods are mostly blocking, eager, and buffered, which are problematic when data gets big.

def ls(self, path_prefix: str) -> List[str]:
"""
:returns: a list of all files under a given path prefix.
"""
...

  • StorageManager.ls should return Iterable[str] instead of List[str]

def upload_obj(self, file_path: str, contents: AnyStr, content_type: Optional[str] = None):
"""
Upload file data to the storage service.
:param file_path: file path to upload to
:param contents: file data
:param content_type: optional media type, e.g. "text/plain"
"""
...
def download_obj(self, file_path: str) -> AnyStr:
"""
Download file data from the storage service.
"""
...

  • StorageManager.upload_obj should accept a BytesIO instead of AnyStr

  • StorageManager.download_obj should return a ContextManager[BytesIO] instead of AnyStr

  • StorageManager.delete_path could take a while, so there should be a mechanism for monitoring its progress

  • StorageManager.move_path could take a while, so there should be a mechanism for monitoring its progress

  • StorageManager.copy_path could take a while, so there should be a mechanism for monitoring its progress

@jennydaman
Copy link
Contributor Author

Related: #517

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

No branches or pull requests

1 participant