S3 Support
S3 storage is supported via the s3fs package.
One shall install it first.
Read
For LazyReader, there are two options to use s3fs.
S3File
Pass a S3File object to LazyReader directly.
| Python | |
|---|---|
Path String + S3FileSystem
Pass a path string to the object with an explicit
S3FileSystem.
| Python | |
|---|---|
Write, Combine, Append
For LazyWriter and LazyCombiner, passing in a S3File object is not feasible.
Only the second option is supported.
| Python | |
|---|---|
implementation details
The S3 storage does not support random seek in write mode.
However, the TOC can only be updated after all data are serialized.
Thus, it is impossible to directly operate on S3File objects in write mode.
The implementation will create a local temporary file and write the byte stream to it.
Once all contents are written and updated properly, the whole blob will be uploaded to the S3 storage.
minimum local storage requirement
Due to the above limitation, the local storage must have sufficient space to write the whole blob.
Local Demo
Here we show a local demo using rustfs with minimum configuration.
The following command spins up a rustfs container in the background.
| Bash | |
|---|---|
Now one can use the default credentials to connect. After successful connection, just write/read as normal.