-
Notifications
You must be signed in to change notification settings - Fork 33
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
Al 131 add streaming read #33
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #33 +/- ##
==========================================
+ Coverage 60.89% 61.17% +0.28%
==========================================
Files 115 115
Lines 9852 9981 +129
==========================================
+ Hits 5999 6106 +107
- Misses 3853 3875 +22
Continue to review full report at Codecov.
|
if self.readthread is None: | ||
self.readthread = threading.Thread(target=self.retrMethod(chunk_size), daemon=True) | ||
self.readthread.start() | ||
chunk = self.filequeue.get() |
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.
Make sure read method doesn't get blocked forever if there is an extra call to read after the last one that returns none
self.response.close() | ||
|
||
def read(self, chunk_size=1024): | ||
return next(self.response.iter_content(chunk_size=chunk_size)) |
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.
Correct me if I'm wrong, but we probably don't want to be created a new iterator on every call to read
@@ -139,3 +150,16 @@ def _join(base, path): | |||
if base is None: | |||
return path | |||
return os.path.join(base, path.lstrip("/")).replace("\\", "/") | |||
|
|||
class TransportReadStreamLocal(TransportReadStream): |
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.
You probably don't need this class, and can return the file object directly from read
- Adds TransportFile and TransportFile children objects
- Adds TransportReadStreamS3 object
- Adds FTP implementation
- Changes TransportFile to TransportReadStream - Adds some tests - Fixes s3 Transport's read function - Adds sftp Transport's read function
- Adds HTTP read implementation - Adds testing for local, http, https read
- creates infrastructure for FTP test with docker container
- Adds ftp filestore tests - Adds ftpserver docker container
- Adds SFTP server container to docker compose - Adds lines for testing read() operations
a3e3354
to
c805dd5
Compare
A PR to discuss ongoing work related to streaming read operations in the filestore