Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
456 commits
Select commit Hold shift + click to select a range
ab8b83b
refactor: remove currently unused N5BlockCodec. Something like this m…
cmhulbert Apr 8, 2025
2e05628
refactor: dont expose N5Codecs internals
cmhulbert Apr 8, 2025
d4ebfef
refactor: rename encodeBlockHeader -> createBlockHeader
cmhulbert Apr 8, 2025
0dcade4
feat: add ZarrStringDataCodec support
cmhulbert Apr 8, 2025
b4ca260
tmp
cmhulbert May 12, 2025
c1485a9
Merge branch 'codecsReadData' into zarr3-readdata
cmhulbert May 12, 2025
95e5aff
Merge branch 'master' into wip/codecsReadData
cmhulbert May 20, 2025
1ba662d
chore: remove duplicate license headers
cmhulbert May 20, 2025
31e0a9a
test: add ReadData benchmark
bogovicj May 20, 2025
38017ff
fix: AbstractInputStreamReadData close stream
bogovicj May 20, 2025
20b5c00
feat: add splittable read data
bogovicj May 20, 2025
c7a119e
test: fix ShardProperties tests
bogovicj May 21, 2025
1564aa5
feat: add FileSplittableReadData
bogovicj May 21, 2025
fecd95d
test: more ReadDataTests
bogovicj May 21, 2025
2481791
test: more read data benchmarks
bogovicj May 21, 2025
424c101
perf: use range request for http KeyValueAccess
bogovicj May 22, 2025
0023d4e
fix(test): add N5BlockCodec to shard test
cmhulbert May 22, 2025
02e0488
Merge remote-tracking branch 'origin/wip/codecsReadData-splittable' i…
cmhulbert May 22, 2025
d8aedbd
perf/style: http kva, implement range request
bogovicj May 22, 2025
967df11
Merge branch 'wip/codecsReadData' of github.com:saalfeldlab/n5 into w…
bogovicj May 22, 2025
3d27db9
refactor: rename to ArrayCodec#initialize
cmhulbert May 23, 2025
f394937
feat: ReadDataSplittableReadData and KVA#createReadData;
cmhulbert May 23, 2025
b56a394
refactor: Shards should use ReadData, not previous SplitData implemen…
cmhulbert May 23, 2025
2cc81aa
refactor(test): for sharding
cmhulbert May 23, 2025
1c5f0c1
chore: feedback
cmhulbert May 23, 2025
c274213
fix: write ShardIndex before closing output stream
cmhulbert May 23, 2025
3486b0f
wip: FileSplittableReadData now wraps a kva
bogovicj May 23, 2025
25b2f5c
Merge branch 'wip/codecsReadData' of github.com:saalfeldlab/n5 into w…
bogovicj May 23, 2025
11cc2e2
rm ReadDataBenchmarksKvaReadFully
bogovicj May 23, 2025
6edda5f
test: FileSplittableReadData knows its length
bogovicj May 23, 2025
521b6aa
feat,BREAKING: wrap IO as N5IO and rethrow; don't throw IOException i…
cmhulbert May 23, 2025
3242dc7
fix(test): index should have RawBytesCodec
cmhulbert May 23, 2025
a56c80b
wip: refactor KvaSplittableReadData
bogovicj May 23, 2025
1573748
fix: N5BlockCodec adds header size to encoded size
cmhulbert May 23, 2025
d8504eb
refactor: branch sharding logic on ShardingCodec
cmhulbert May 23, 2025
65345d9
doc: SplittableReadData.slice
bogovicj May 23, 2025
b9130de
refactor: hide KeyValueAccessSplittableReadData
bogovicj May 23, 2025
2243a4f
perf: FileSystemKva's ReadData uses lockForReading
bogovicj May 23, 2025
19af7cc
test: add CodecTests
bogovicj May 23, 2025
c3a87cb
refactor: remove deprecated api methods, some cleanup
cmhulbert May 27, 2025
db0e1a3
feat: Shard as a the base case for writing
cmhulbert May 27, 2025
c8c4335
fix: NameConfig for Bzip2
cmhulbert May 27, 2025
4f29c33
fix: getArrayCodec not ShardingCodec
cmhulbert May 27, 2025
ceaf5c3
chore: remove duplicate/outdated license header
cmhulbert May 27, 2025
d7c9d35
test: writing / reading of invalid blocks
bogovicj May 27, 2025
5d13af6
refactor: extract Pattern matching to be reused for attribute path no…
cmhulbert Jun 2, 2025
2acc281
refactor: migrate IOExceptions to N5IOExceptions for ReadData and rel…
cmhulbert Jun 2, 2025
2144660
feat: support writing blocks through shards on non-sharded datasets
cmhulbert Jun 10, 2025
6c4156c
feat: more block as shard logic
cmhulbert Jun 12, 2025
74e1f70
test: make test data smaller
cmhulbert Jun 12, 2025
3c20ea0
refactor: static readFromShard
cmhulbert Jun 12, 2025
fff741b
test: write shard for http fs tests
cmhulbert Jun 12, 2025
bf0920c
feat: annotation to indicate a non-serializable NameConfig
cmhulbert Jun 12, 2025
481f75a
misc: cleanup more blockAsShard stuff
cmhulbert Jun 12, 2025
fbae8ac
test: BlockAsShard AbstractN5 Test
cmhulbert Jun 12, 2025
ba7c3e0
Merge branch 'wip/codecs' into development
cmhulbert Jun 13, 2025
41d5281
Merge branch 'splittable-readdata' into development
cmhulbert Jun 13, 2025
fccd7e6
Merge branch 'wip/codecsReadData' into development
cmhulbert Jun 13, 2025
5c9a4f0
wip: shard merge after staged PR merges
cmhulbert Jun 13, 2025
6ed4d8f
Merge branch 'master' into development
cmhulbert Jun 24, 2025
b1c785b
doc: update README.md
cmhulbert Jun 24, 2025
a5c44d4
Merge branch 'master' into development
cmhulbert Jun 27, 2025
d0158c2
chore!: remove AsTypeCodec and related logic
cmhulbert Jun 27, 2025
a541c2f
chore: cleanup for PR
cmhulbert Jun 27, 2025
9e11534
feat: add Shard.blockExists
bogovicj Jun 28, 2025
77e86e4
feat!: add N5Writer.deleteShard
bogovicj Jun 28, 2025
e1468f1
fix/test: fix N5Codecs.getSize
bogovicj Jun 30, 2025
936091d
refactor/test: remove ShardProperties
bogovicj Jul 1, 2025
e22e505
refactor!: blockPositions for shard methods are shardRelative
bogovicj Jul 2, 2025
3ea57cc
feat: add GridIterator.nextInt
bogovicj Jul 2, 2025
d31ce22
feat/doc: add ShardIndex.setEmpty
bogovicj Jul 3, 2025
2be0d47
refactor: mark getCompression() as deprecated
bogovicj Jul 7, 2025
7c5bd7e
fix/test: serialization of DatasetAttributes
bogovicj Jul 7, 2025
1f93f68
fix: ShardingCodec.getCodecs
bogovicj Jul 8, 2025
939cb77
fix: InMemoryShard.fromShard returns null for null input
bogovicj Jul 8, 2025
6ed67a8
test: TestN5ShardWriter should not register Compression adapter
bogovicj Jul 8, 2025
a9e9822
feat: add GridIterator.positionToIndex
bogovicj Jul 9, 2025
0fa2408
Merge branch 'master' into development
cmhulbert Aug 13, 2025
75772b8
feat: DatasetAttributes.getCodecs
bogovicj Aug 20, 2025
7915ed3
feat: getAttributesKey method
bogovicj Aug 20, 2025
51e510d
fix: remove attribute should use setAttributes
bogovicj Aug 26, 2025
bce0138
RawBytes type should be "bytes"
bogovicj Aug 26, 2025
7b9dee4
feat: make registerGson an instance method
bogovicj Aug 26, 2025
d78f161
temp
tpietzsch Aug 27, 2025
f1e82a7
Merge remote-tracking branch 'origin/master' into feat/attributesKey
bogovicj Aug 27, 2025
609e4f2
WIP
tpietzsch Aug 27, 2025
4e3d353
Remove superfluous modifiers
tpietzsch Aug 28, 2025
2f2e2fe
WIP BlockCodecInfo
tpietzsch Aug 28, 2025
0f84cb5
WIP
tpietzsch Aug 28, 2025
f8abd61
WIP
tpietzsch Aug 28, 2025
72ede54
WIP
tpietzsch Aug 28, 2025
a97e604
WIP
tpietzsch Aug 28, 2025
d9e2f37
WIP
tpietzsch Aug 28, 2025
94fdf95
move WIP to separate package
tpietzsch Aug 29, 2025
4b65d41
WIP NestedGrid
tpietzsch Aug 29, 2025
1dd88cb
refactor: large renaming to align with master before merge
cmhulbert Aug 29, 2025
f255fd8
Merge branch 'master' into development
cmhulbert Aug 29, 2025
37b51ce
WIP NestedPosition
tpietzsch Aug 29, 2025
637cb52
WIP nested decoding again
tpietzsch Aug 29, 2025
8d2232d
WIP nested decoding
tpietzsch Aug 30, 2025
d041601
WIP SegmentedReadData
tpietzsch Aug 31, 2025
7704814
wip
tpietzsch Sep 1, 2025
ed349e2
WIP SegmentedReadData
tpietzsch Sep 2, 2025
e32e7b0
Revise ReadData implementations to return itself from materialize()
tpietzsch Sep 2, 2025
02013f4
WIP
tpietzsch Sep 2, 2025
f503f55
WIP slicing
tpietzsch Sep 2, 2025
686da94
WIP clean up
tpietzsch Sep 2, 2025
c6019fd
WIP Concatenate
tpietzsch Sep 3, 2025
9d641f3
WIP handle ReadData.slice with length < 0
tpietzsch Sep 4, 2025
d719fbb
Add ReadData.materialize javadoc (implementation note)
tpietzsch Sep 4, 2025
44d5a75
Add ReadData.requireLength
tpietzsch Sep 3, 2025
c4ea774
WIP requireLength
tpietzsch Sep 5, 2025
0b2c658
Segment.source() is the SegmentedReadData that originally defined it
tpietzsch Sep 5, 2025
d29a4f2
Revise DataCodecInfo to take DataType and blockSize instead of Datase…
tpietzsch Sep 5, 2025
455afce
WIP
tpietzsch Sep 5, 2025
7f87a74
WIP ShardIndex to/from Segments
tpietzsch Sep 5, 2025
55a0962
WIP
tpietzsch Sep 6, 2025
30d9e40
clean up
tpietzsch Sep 6, 2025
816924c
javadoc
tpietzsch Sep 6, 2025
e0289b7
WIP RawShard deconding
tpietzsch Sep 6, 2025
8f7e4c3
javadoc
tpietzsch Sep 6, 2025
9f56850
refactor
tpietzsch Sep 6, 2025
69f27ed
WIP RawShard encoding
tpietzsch Sep 6, 2025
926348c
WIP RawShard encoding
tpietzsch Sep 6, 2025
2b1a38d
clean up
tpietzsch Sep 6, 2025
9b501dd
refactor
tpietzsch Sep 7, 2025
d3cae93
WIP index CodecInfo and location
tpietzsch Sep 7, 2025
524b2e7
WIP dummy CodecInfos
tpietzsch Sep 7, 2025
a9d9500
DefaultShardCodecInfo
tpietzsch Sep 7, 2025
353d2ac
WIP
tpietzsch Sep 8, 2025
b482a4b
WIP DatasetAccess<T>
tpietzsch Sep 8, 2025
8fc9244
WIP
tpietzsch Sep 8, 2025
0e00fea
WIP testing
tpietzsch Sep 8, 2025
0900018
bugfix: ReadData should know its length() after writeTo(OutputStream)
tpietzsch Sep 8, 2025
e233eab
WIP testing
tpietzsch Sep 8, 2025
35166d8
WIP deleteBlock
tpietzsch Sep 8, 2025
6531f00
Add some TODOs
tpietzsch Sep 8, 2025
9627749
Clean up
tpietzsch Sep 8, 2025
dad4adc
refactor
tpietzsch Sep 8, 2025
76c83c0
refactor
tpietzsch Sep 8, 2025
cba45a4
refactor
tpietzsch Sep 8, 2025
ca0c9f8
add TODO
tpietzsch Sep 12, 2025
f9645d8
MAke ShardIndex package-private
tpietzsch Sep 12, 2025
500f600
clean up
tpietzsch Sep 12, 2025
ce46473
Add BlockDodec.encodedSize(int[]) and implementations
tpietzsch Sep 12, 2025
73042cc
Concatenation of DeterministicSizeDataCodec
tpietzsch Sep 13, 2025
6b284e0
RawCompression is a DeterministicSizeDataCodec
tpietzsch Sep 13, 2025
373c0ec
fix/test: ReadData test for length vs requiredLength
bogovicj Sep 17, 2025
6dec879
feat!: use DatasetAccess instead of BlockCodec
bogovicj Sep 18, 2025
db1928d
Revise SegmentLocation
tpietzsch Sep 22, 2025
e8ce75b
Slice prefetching math and tests
tpietzsch Sep 22, 2025
2082f86
WIP: Add SliceTrackingReadData
tpietzsch Sep 22, 2025
cc1312a
WIP: Always use SliceTrackingReadData in SegmentedReadData wrapper
tpietzsch Sep 22, 2025
9709889
Add (empty) prefetch method
tpietzsch Sep 22, 2025
39f1c8a
minimal prefetch implementation
tpietzsch Sep 22, 2025
3ac4f2f
Merge branch 'nesting' into development
bogovicj Sep 23, 2025
8cba4f9
Merge remote-tracking branch 'origin/nesting' into wip/nesting-into-d…
bogovicj Sep 23, 2025
552d712
fix: NestedGrid validates blockSizes
bogovicj Sep 24, 2025
1861cc1
fix: use NestedGrid for error checking
bogovicj Sep 24, 2025
ec27cb5
fix: Nesting blockSize size checks were backwards
bogovicj Sep 24, 2025
10b87c2
feat: add NestedGrid.getBlockSize
bogovicj Sep 24, 2025
07b4b81
fix: DatasetAttributes build dataCodecInfos from shard size
bogovicj Sep 24, 2025
3d97e94
wip: tmp comment shard related things
bogovicj Sep 24, 2025
1db5b73
fix: ShardedDatasetAccess create method with validation
bogovicj Sep 25, 2025
e61b513
fix: null check on existingData in writeBlockRecursive is not enough
bogovicj Sep 25, 2025
6232eda
fix: ShardedDatasetAccess set existingData to null if no key
bogovicj Sep 26, 2025
8f7f5da
feat: serialization for DefaultShardCodecInfo and RawCompression
bogovicj Oct 6, 2025
e172536
partially working ShardTest
bogovicj Oct 6, 2025
2091dad
make DatasetAccess transient
bogovicj Oct 6, 2025
ff994d4
feat: nested implementation of readBlocks/writeBlocks
cmhulbert Oct 6, 2025
3dcb8f0
test: start backward compatibility tests
bogovicj Oct 8, 2025
7751fad
Merge branch 'wip/nesting-into-development' of github.com:saalfeldlab…
bogovicj Oct 8, 2025
c940ebb
style: rm unused dependencies
bogovicj Oct 14, 2025
493db08
remove read/write/delete Shard interface methods
bogovicj Oct 14, 2025
901642c
test: ignore testWriteInvalidBlock for the moment
bogovicj Oct 14, 2025
a379ed4
remove read/write Shard implementations
bogovicj Oct 14, 2025
feb70af
createDataset takes Block/DataCodecInfos
bogovicj Oct 14, 2025
98d7618
n5.list returns a sorted list
bogovicj Oct 14, 2025
e73ecd3
DatasetAttributes clean up
bogovicj Oct 14, 2025
f5385ba
feat: add block / data codecinfo getters
bogovicj Oct 14, 2025
6e2dfd3
feat: DatasetAttributes can map grid positions to relative path
bogovicj Oct 14, 2025
61e6075
fix: NameConfig.Names should not collid with CompressionType name
bogovicj Oct 16, 2025
ace0b16
test: remove hard-coded compressor for testOverwriteBlock
bogovicj Oct 16, 2025
16cd811
feat: StringDataBlock uses UTF_8 encoding
bogovicj Oct 16, 2025
1f13153
refactor: rename ShardedDatasetAccess to DefaultDatasetAccess
bogovicj Oct 17, 2025
24a75d6
test: AbstractN5Test fix random seed
bogovicj Oct 17, 2025
10fc3df
refactor: rm old shard classes, shardstuff -> shard
bogovicj Oct 17, 2025
7c5b609
clean up
tpietzsch Oct 21, 2025
efc6b57
Remove redundant modifier
tpietzsch Sep 23, 2025
eeca2a4
Add prefetch() to ReadData interface
tpietzsch Sep 23, 2025
5a1d57c
DefaultSegmentedReadData forwards prefetch() to delegate
tpietzsch Sep 23, 2025
4d2d201
javadoc
tpietzsch Oct 21, 2025
c8f0cad
clean up imports
tpietzsch Oct 21, 2025
d3b111a
Use SegmentLocation.at instead of constructor
tpietzsch Oct 21, 2025
6fb023c
refactor: Make DefaultSegmentLocation a local class
tpietzsch Oct 21, 2025
a4ea057
refactor: rename SegmentLocation to Range and move to readdata package
tpietzsch Oct 21, 2025
81a4890
fix: return empty list for readBlocks over nonexistent blocks, not null
cmhulbert Oct 21, 2025
f807bd7
javadoc
tpietzsch Oct 21, 2025
de5ec1a
refactor: rename Concatenate to ConcatenatedReadData
tpietzsch Oct 22, 2025
d987cd4
augment and document concatenate test
tpietzsch Oct 22, 2025
e980a04
Add static Range.equals() to check two Ranges for equality
tpietzsch Oct 22, 2025
387a10b
javadoc
tpietzsch Oct 22, 2025
80d9e01
fix: IdentityCodec implements DeterministicSizeDataCodec
bogovicj Oct 22, 2025
6c99a00
wip!: DatasetAttributes changes
bogovicj Oct 22, 2025
9186e2d
fix: DefaultShardCodecInfo's serialization
bogovicj Oct 22, 2025
7120b38
test: update getTestAttributes given dstAttribute changes
bogovicj Oct 22, 2025
15c5768
Merge branch 'development' of github.com:saalfeldlab/n5 into development
bogovicj Oct 22, 2025
0b8ffed
javadoc
tpietzsch Oct 22, 2025
5eab766
refactor/doc: NestedGrid
bogovicj Oct 22, 2025
8a491ef
typo
tpietzsch Oct 22, 2025
fc4a1ec
clean up
tpietzsch Oct 22, 2025
8b9a85f
test: more NestedGrid tests
bogovicj Oct 22, 2025
26576f2
Merge branch 'development' of github.com:saalfeldlab/n5 into development
bogovicj Oct 22, 2025
d53b7a6
test: additions to ShardTest
bogovicj Oct 22, 2025
685eabe
feat: add NestedGrid.positionInSubGrid
bogovicj Oct 23, 2025
14cd4f5
Merge remote-tracking branch 'origin/master' into development
bogovicj Oct 23, 2025
8442671
Merge branch 'master' into feat/attributesKey
bogovicj Oct 23, 2025
574127b
Merge branch 'feat/attributesKey' into development
bogovicj Oct 23, 2025
7fe7749
feat(test): change test size defaults so the dimensions are larger th…
cmhulbert Oct 24, 2025
a4f8b4c
test: generalize ShardTest for n5-zarr re-use
bogovicj Oct 28, 2025
e9ece6e
doc: improve Nesting.positionInSubGrid doc
bogovicj Oct 28, 2025
152aef6
Merge branch 'development' of github.com:saalfeldlab/n5 into development
bogovicj Oct 28, 2025
ddcc821
test: add extensible method that defines illegal characters
bogovicj Oct 29, 2025
380964c
test: start of partial read benchmarks
bogovicj Aug 16, 2024
1de7b70
fix(test): don't specify relative paths for createTempN5Writer; in th…
cmhulbert Oct 29, 2025
162309c
feat: add getNestedBlockGrid method to DatasetAttributes
bogovicj Oct 29, 2025
2e5d86b
test: update tests to work with less accessible DatasetAccess
bogovicj Oct 29, 2025
1ea9da2
doc: correct DatasetAttributes.getDatasetAccess
bogovicj Oct 31, 2025
5f23b09
test: clean up ShardTest
bogovicj Nov 3, 2025
0dff849
feat!/test: clean up N5Writer delete implementation
bogovicj Nov 3, 2025
ebca340
BREAING!: rm GsonKeyValueN5Reader.absoluteDataBlockPath
bogovicj Nov 3, 2025
ef2de58
refactor!: PositionValueAccess takes DatasetAttributes
bogovicj Nov 3, 2025
06a1e2d
test: rm unused testWriteReadShardOnUnshardedDataset
bogovicj Nov 3, 2025
619f308
style!: rm unused method registerGson
bogovicj Nov 3, 2025
1bb10bb
style!: remove unused classes
bogovicj Nov 3, 2025
552d416
chore!: rm tentative blockExists method stub
bogovicj Nov 3, 2025
94b0918
Squashed commit of the following:
bogovicj Nov 3, 2025
14dbc77
test: DatasetAttributesTest test NestedGrid
bogovicj Nov 3, 2025
7adab79
Merge branch 'development' into dev/sharding-squash
bogovicj Nov 3, 2025
fd9b715
doc: javadoc fixes
bogovicj Nov 3, 2025
9223f51
Merge remote-tracking branch 'origin/development' into dev/sharding-s…
bogovicj Nov 3, 2025
0b8d4c9
fix: correctly handle redirect for `isFile` and `isDirectory()` call …
cmhulbert Nov 4, 2025
18702dc
fix(test): get cache field from N5KeyValueReader class
cmhulbert Nov 4, 2025
19903c4
refactor: don't explicitly handle the cache case in createGroup guard…
cmhulbert Nov 4, 2025
e5d52b3
Merge remote-tracking branch 'origin/development' into dev/sharding-s…
bogovicj Nov 4, 2025
453e839
style: remove commented old methods
bogovicj Nov 5, 2025
944c3aa
test: backend shard read behavior
bogovicj Nov 5, 2025
8477283
refactor: expose `groupInnerPositions` and move it to `DatasetAccess`…
cmhulbert Nov 5, 2025
2b57346
Merge remote-tracking branch 'origin/development' into dev/sharding-s…
bogovicj Nov 5, 2025
caa835f
Merge branch 'dev/sharding-squash' of github.com:saalfeldlab/n5 into …
bogovicj Nov 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.scijava</groupId>
<artifactId>pom-scijava</artifactId>
<version>40.0.0</version>
<version>43.0.0</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -161,13 +161,36 @@
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>org.scijava</groupId>
<artifactId>scijava-common</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.janelia.saalfeldlab</groupId>
<artifactId>n5-universe</artifactId>
<exclusions>
<exclusion>
<groupId>org.janelia.saalfeldlab</groupId>
<artifactId>n5</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.imagej</groupId>
<artifactId>ij</artifactId>
Expand All @@ -194,13 +217,16 @@
<version>${commons-collections4.version}</version>
<scope>test</scope>
</dependency>
<!-- JMH -->
<dependency>
<groupId>org.scijava</groupId>
<artifactId>scijava-common</artifactId>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<scope>test</scope>
</dependency>

<!-- JMH -->
Expand Down
31 changes: 3 additions & 28 deletions src/main/java/org/janelia/saalfeldlab/n5/AbstractDataBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,6 @@
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/
/**
* Copyright (c) 2017, Stephan Saalfeld
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package org.janelia.saalfeldlab.n5;

import java.util.function.ToIntFunction;
Expand All @@ -65,9 +40,9 @@
*/
public abstract class AbstractDataBlock<T> implements DataBlock<T> {

private final int[] size;
private final long[] gridPosition;
private final T data;
protected final int[] size;
protected final long[] gridPosition;
protected final T data;
private final ToIntFunction<T> numElements;

public AbstractDataBlock(
Expand Down
25 changes: 0 additions & 25 deletions src/main/java/org/janelia/saalfeldlab/n5/ByteArrayDataBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,6 @@
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/
/**
* Copyright (c) 2017, Stephan Saalfeld
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package org.janelia.saalfeldlab.n5;

public class ByteArrayDataBlock extends AbstractDataBlock<byte[]> {
Expand Down
25 changes: 0 additions & 25 deletions src/main/java/org/janelia/saalfeldlab/n5/Bzip2Compression.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,6 @@
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/
/**
* Copyright (c) 2017, Stephan Saalfeld
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package org.janelia.saalfeldlab.n5;

import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ default DatasetAttributes getDatasetAttributes(final String pathName) {
return null;

if (cacheMeta()) {
attributes = getCache().getAttributes(normalPath, N5KeyValueReader.ATTRIBUTES_JSON);
attributes = getCache().getAttributes(normalPath, getAttributesKey());
} else {
attributes = GsonKeyValueN5Reader.super.getAttributes(normalPath);
}
Expand All @@ -99,7 +99,7 @@ default <T> T getAttribute(

final JsonElement attributes;
if (cacheMeta()) {
attributes = getCache().getAttributes(normalPathName, N5KeyValueReader.ATTRIBUTES_JSON);
attributes = getCache().getAttributes(normalPathName, getAttributesKey());
} else {
attributes = GsonKeyValueN5Reader.super.getAttributes(normalPathName);
}
Expand All @@ -120,7 +120,7 @@ default <T> T getAttribute(
final String normalizedAttributePath = N5URI.normalizeAttributePath(key);
JsonElement attributes;
if (cacheMeta()) {
attributes = getCache().getAttributes(normalPathName, N5KeyValueReader.ATTRIBUTES_JSON);
attributes = getCache().getAttributes(normalPathName, getAttributesKey());
} else {
attributes = GsonKeyValueN5Reader.super.getAttributes(normalPathName);
}
Expand All @@ -136,7 +136,7 @@ default boolean exists(final String pathName) {

final String normalPathName = N5URI.normalizeGroupPath(pathName);
if (cacheMeta())
return getCache().isGroup(normalPathName, N5KeyValueReader.ATTRIBUTES_JSON);
return getCache().isGroup(normalPathName, getAttributesKey());
else {
return existsFromContainer(normalPathName, null);
}
Expand Down Expand Up @@ -180,7 +180,7 @@ default boolean datasetExists(final String pathName) throws N5IOException {

final String normalPathName = N5URI.normalizeGroupPath(pathName);
if (cacheMeta()) {
return getCache().isDataset(normalPathName, N5KeyValueReader.ATTRIBUTES_JSON);
return getCache().isDataset(normalPathName, getAttributesKey());
}
return isDatasetFromContainer(normalPathName);
}
Expand Down Expand Up @@ -212,7 +212,7 @@ default JsonElement getAttributes(final String pathName) throws N5IOException {

/* If cached, return the cache */
if (cacheMeta()) {
return getCache().getAttributes(groupPath, N5KeyValueReader.ATTRIBUTES_JSON);
return getCache().getAttributes(groupPath, getAttributesKey());
} else {
return GsonKeyValueN5Reader.super.getAttributes(groupPath);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
*/
package org.janelia.saalfeldlab.n5;

import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.Arrays;

import org.janelia.saalfeldlab.n5.N5Exception.N5IOException;

import com.google.gson.Gson;
Expand Down Expand Up @@ -61,19 +57,11 @@ default void createGroup(final String path) throws N5Exception {
// avoid hitting the backend if this path is already a group according to the cache
// else if exists is true (then a dataset is present) so throw an exception to avoid
// overwriting / invalidating existing data
if (cacheMeta()) {
if (getCache().isGroup(normalPath, N5KeyValueReader.ATTRIBUTES_JSON))
return;
else if (getCache().exists(normalPath, N5KeyValueReader.ATTRIBUTES_JSON)) {
throw new N5Exception("Can't make a group on existing path.");
}
}
if (groupExists(normalPath))
return;
else if (datasetExists(normalPath))
throw new N5Exception("Can't make a group on existing dataset.");

// N5Writer.super.createGroup(path);
/*
* the lines below duplicate the single line above but would have to call
* normalizeGroupPath again the below duplicates code, but avoids extra work
*/
getKeyValueAccess().createDirectories(absoluteGroupPath(normalPath));

if (cacheMeta()) {
Expand All @@ -88,8 +76,8 @@ else if (getCache().exists(normalPath, N5KeyValueReader.ATTRIBUTES_JSON)) {
for (final String child : pathParts) {

final String childPath = parent.isEmpty() ? child : parent + "/" + child;
getCache().initializeNonemptyCache(childPath, N5KeyValueReader.ATTRIBUTES_JSON);
getCache().updateCacheInfo(childPath, N5KeyValueReader.ATTRIBUTES_JSON);
getCache().initializeNonemptyCache(childPath, getAttributesKey());
getCache().updateCacheInfo(childPath, getAttributesKey());

// only add if the parent exists and has children cached already
if (parent != null && !child.isEmpty())
Expand Down Expand Up @@ -130,7 +118,7 @@ default void writeAndCacheAttributes(
nullRespectingAttributes = getGson().toJsonTree(attributes);
}
/* Update the cache, and write to the writer */
getCache().updateCacheInfo(normalGroupPath, N5KeyValueReader.ATTRIBUTES_JSON, nullRespectingAttributes);
getCache().updateCacheInfo(normalGroupPath, getAttributesKey(), nullRespectingAttributes);
}
}

Expand Down
34 changes: 5 additions & 29 deletions src/main/java/org/janelia/saalfeldlab/n5/Compression.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,6 @@
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/
/**
* Copyright (c) 2017, Stephan Saalfeld
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package org.janelia.saalfeldlab.n5;

import java.io.Serializable;
Expand All @@ -61,8 +36,8 @@
import java.lang.annotation.Target;

import org.janelia.saalfeldlab.n5.codec.DataCodec;
import org.janelia.saalfeldlab.n5.codec.DataCodecInfo;
import org.janelia.saalfeldlab.n5.codec.CodecInfo;
import org.janelia.saalfeldlab.n5.codec.DataCodecInfo;
import org.scijava.annotations.Indexable;

/**
Expand All @@ -74,11 +49,12 @@
* serialization.
* <p>
* See also: an alternative method for serializing general {@link CodecInfo}s is
* with the {@link NameConfigAdapter}.
* with the {@link NameConfigAdapter}. This interface remains for legacy
* (de)serialization.
*
* @author Stephan Saalfeld
*/
public interface Compression extends Serializable, DataCodecInfo, DataCodec {
public interface Compression extends Serializable, DataCodec, DataCodecInfo {

/**
* Annotation for runtime discovery of compression schemes.
Expand All @@ -102,7 +78,6 @@ public interface Compression extends Serializable, DataCodecInfo, DataCodec {
@Target(ElementType.FIELD)
@interface CompressionParameter {}

@Override
default String getType() {

final CompressionType compressionType = getClass().getAnnotation(CompressionType.class);
Expand All @@ -116,4 +91,5 @@ default String getType() {
default DataCodec create() {
return this;
}

}
27 changes: 1 addition & 26 deletions src/main/java/org/janelia/saalfeldlab/n5/CompressionAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,6 @@
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/
/**
* Copyright (c) 2017, Stephan Saalfeld
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package org.janelia.saalfeldlab.n5;

import java.lang.reflect.Constructor;
Expand Down Expand Up @@ -124,7 +99,7 @@ public static synchronized void update(final boolean override) {

newInstance.compressionConstructors.put(type, constructor);
newInstance.compressionParameters.put(type, parameters);
} catch (final ClassNotFoundException | NoSuchMethodException | ClassCastException
} catch (final NoClassDefFoundError | ClassNotFoundException | NoSuchMethodException | ClassCastException
| UnsatisfiedLinkError e) {
System.err.println("Compression '" + item.className() + "' could not be registered");
}
Expand Down
Loading