Skip to content

Conversation

markgoddard
Copy link

@markgoddard markgoddard commented Jun 29, 2023

This allows the S3 active storage server to work with data that was
compressed using one of these algorithms before it was written to the
object store.

Compression is configured using the optional compression field in the
API JSON request data, and if present should be set to "gzip" or "zlib".

We are using the standard flate2 library for decompression. There may be
more performant options to consider in future, but this works well as a
first pass, and changing in future will not affect the API.

@markgoddard markgoddard self-assigned this Jun 29, 2023
This allows the S3 active storage server to work with data that was
compressed using one of these algorithms before it was written to the
object store.

Compression is configured using the optional `compression` field in the
API JSON request data, and if present should be set to "gzip" or "zlib".

We are using the standard flate2 library for decompression. There may be
more performant options to consider in future, but this works well as a
first pass, and changing in future will not affect the API.
When data is compressed, the size parameter refers to the size of the
compressed data. Typically this is not equal to the size of the
uncompressed data, so we can't validate it against the data type size.

This change skips initial size/dtype validation when compression is
applied, instead performing it once the data has been decompressed.

It also adds an additional validation that the size matches the shape,
when a shape has been specified.
@markgoddard markgoddard changed the title Add support for DEFLATE, Gzip and Zlib compression Add support for Gzip and Zlib compression Jul 11, 2023
This allows us to more easily support compression algorithms that have
decompression parameters.
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.

1 participant