Skip to content

Codecs and serialization - #157

Merged
bogovicj merged 32 commits into
masterfrom
wip/codecs
Jul 30, 2025
Merged

Codecs and serialization #157
bogovicj merged 32 commits into
masterfrom
wip/codecs

Conversation

@bogovicj

@bogovicj bogovicj commented Jun 5, 2025

Copy link
Copy Markdown
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
@bogovicj
bogovicj requested review from cmhulbert and tpietzsch June 5, 2025 21:50
@bogovicj

bogovicj commented Jun 5, 2025

Copy link
Copy Markdown
Contributor Author

No sharding codec in this PR, we can add that after both this PR and #156 are merged

@bogovicj

bogovicj commented Jun 5, 2025

Copy link
Copy Markdown
Contributor Author

Considering different names for these two classes:

  • ArrayCodec

    • DatasetCodec
  • DataBlockCodec

    • TypedArrayCodec
    • ArrayCodecInstance
    • DataBlockReadData

If DataBlockCodec were more hidden, the name would not matter as much

bogovicj added 2 commits June 5, 2025 19:35
* their purpose replaced by ArrayCodec, which is more extensible
Comment thread src/main/java/org/janelia/saalfeldlab/n5/codec/RawBlockCodecs.java Outdated
Comment thread src/main/java/org/janelia/saalfeldlab/n5/GsonKeyValueN5Reader.java Outdated
bogovicj and others added 16 commits June 10, 2025 19:09
* 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
tpietzsch and others added 9 commits July 29, 2025 11:26
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
@bogovicj
bogovicj merged commit 8dbc822 into master Jul 30, 2025
2 checks passed
@cmhulbert
cmhulbert deleted the wip/codecs branch November 5, 2025 21:13
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.

3 participants