Codecs and serialization - #157
Merged
Merged
Conversation
bogovicj
commented
Jun 5, 2025
Contributor
- Compression classes extend BytesCodec
- ArrayCodecs have DataBlockCodecs
- NamedConfig serialization annotations
- changes to DatasetAttributes
* Compression classes extend BytesCodec * ArrayCodecs have DataBlockCodecs * NamedConfig serialization annotations * changes to DatasetAttributes
Contributor
Author
|
No sharding codec in this PR, we can add that after both this PR and #156 are merged |
Contributor
Author
|
Considering different names for these two classes:
If DataBlockCodec were more hidden, the name would not matter as much |
* their purpose replaced by ArrayCodec, which is more extensible
cmhulbert
reviewed
Jun 9, 2025
cmhulbert
reviewed
Jun 9, 2025
* remove example usage due to @code block issues with annotations * other minor fixes
# Conflicts: # src/main/java/org/janelia/saalfeldlab/n5/Compression.java # src/main/java/org/janelia/saalfeldlab/n5/DefaultBlockReader.java # src/main/java/org/janelia/saalfeldlab/n5/DefaultBlockWriter.java # src/main/java/org/janelia/saalfeldlab/n5/GsonKeyValueN5Writer.java # src/main/java/org/janelia/saalfeldlab/n5/HttpKeyValueAccess.java # src/main/java/org/janelia/saalfeldlab/n5/codec/N5Codecs.java
…eNotFoundException on 404 or 410 response, so rethrow that as N5NoSuchKey
* prioritize compression serializer over codecs for n5
until necessary...
Too many things were named "Codec". I renamed the classes to de/serialize flat arrays (primitves, String[], and Object[]) into byte streams to "FlatArraySerializer". I renamed the classes to de/serialize DataBlock<T> to "DataBlockSerializer". That leaves "codec" for "BytesCodec" (formerly Compression) and "ArrayCodec" (basically a family of / factory for DataBlockSerializer).
* remove ByteOrder serialization
* given that it is redundant with BytesCodec
* will reintroduce in the PR for sharding
tpietzsch
approved these changes
Jul 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.