Zarr.NET  0.6.1
Zarr reader and writer in .NET
Loading...
Searching...
No Matches
ZarrNET.ShardingConfig Class Referencesealed

Configuration for a sharding_indexed codec parsed from zarr.json. More...

Properties

int[] InnerChunkShape = Array.Empty<int>() [get]
 Inner chunk (sub-chunk) shape within each shard.
 
CodecPipeline InnerPipeline = null! [get]
 Codec pipeline applied to each inner chunk.
 
CodecPipeline IndexPipeline = null! [get]
 Codec pipeline applied to the binary shard index.
 
ShardIndexLocation IndexLocation = ShardIndexLocation.End [get]
 Where the index sits within the shard file: "end" or "start".
 
int[] InnerChunksPerShard = Array.Empty<int>() [get]
 Number of inner chunks per shard along each axis. Computed from shard shape / inner chunk shape.
 
int TotalInnerChunks [get]
 Total number of inner chunks per shard (product of InnerChunksPerShard).
 
int IndexEncodedSize [get]
 Total byte size of the encoded shard index as stored on disk. This is the raw index data (TotalInnerChunks × 16 bytes) plus any overhead added by the index codecs (e.g. crc32c adds 4 bytes).
 

Detailed Description

Configuration for a sharding_indexed codec parsed from zarr.json.

Sharding packs multiple "inner chunks" (sub-chunks) into a single shard file. The shard file contains the compressed inner chunks plus a binary index that maps each inner chunk's grid position to its (offset, length) within the shard.

zarr.json example:

"codecs": [{
"name": "sharding_indexed",
"configuration": {
"chunk_shape": [64, 64],
"codecs": [{"name": "bytes"}, {"name": "blosc", ...}],
"index_codecs": [{"name": "bytes", "configuration": {"endian": "little"}}],
"index_location": "end"
}
}]

The outer chunk_grid.chunk_shape in zarr.json defines the shard shape. The inner chunk_shape here defines the sub-chunk shape within each shard.

Property Documentation

◆ IndexEncodedSize

int ZarrNET.ShardingConfig.IndexEncodedSize
get

Total byte size of the encoded shard index as stored on disk. This is the raw index data (TotalInnerChunks × 16 bytes) plus any overhead added by the index codecs (e.g. crc32c adds 4 bytes).

Used by ShardReader to know how many bytes to slice from the shard file before feeding them into the index codec pipeline for decoding.

62{ get; init; }

◆ IndexLocation

ShardIndexLocation ZarrNET.ShardingConfig.IndexLocation = ShardIndexLocation.End
get

Where the index sits within the shard file: "end" or "start".

43{ get; init; } = ShardIndexLocation.End;

◆ IndexPipeline

CodecPipeline ZarrNET.ShardingConfig.IndexPipeline = null!
get

Codec pipeline applied to the binary shard index.

40{ get; init; } = null!;

◆ InnerChunkShape

int [] ZarrNET.ShardingConfig.InnerChunkShape = Array.Empty<int>()
get

Inner chunk (sub-chunk) shape within each shard.

34{ get; init; } = Array.Empty<int>();

◆ InnerChunksPerShard

int [] ZarrNET.ShardingConfig.InnerChunksPerShard = Array.Empty<int>()
get

Number of inner chunks per shard along each axis. Computed from shard shape / inner chunk shape.

49{ get; init; } = Array.Empty<int>();

◆ InnerPipeline

CodecPipeline ZarrNET.ShardingConfig.InnerPipeline = null!
get

Codec pipeline applied to each inner chunk.

37{ get; init; } = null!;

◆ TotalInnerChunks

int ZarrNET.ShardingConfig.TotalInnerChunks
get

Total number of inner chunks per shard (product of InnerChunksPerShard).

52{ get; init; }

The documentation for this class was generated from the following file: