pub trait ArrayShardedExt: Sealed {
// Required methods
fn is_sharded(&self) -> bool;
fn is_exclusively_sharded(&self) -> bool;
fn subchunk_shape(&self) -> Option<ChunkShape>;
fn effective_subchunk_shape(&self) -> Option<ChunkShape>;
fn subchunk_grid(&self) -> ChunkGrid;
fn subchunk_grid_shape(&self) -> ArrayShape;
}sharding only.Expand description
An Array extension trait to simplify working with arrays using the sharding_indexed codec.
Required Methods§
Sourcefn is_sharded(&self) -> bool
fn is_sharded(&self) -> bool
Returns true if the array to bytes codec of the array is sharding_indexed.
Sourcefn is_exclusively_sharded(&self) -> bool
fn is_exclusively_sharded(&self) -> bool
Returns true if the array-to-bytes codec of the array is sharding_indexed and the array has no array-to-array or bytes-to-bytes codecs.
Sourcefn subchunk_shape(&self) -> Option<ChunkShape>
fn subchunk_shape(&self) -> Option<ChunkShape>
Return the subchunk shape as defined in the sharding_indexed codec metadata.
Returns None for an unsharded array.
Sourcefn effective_subchunk_shape(&self) -> Option<ChunkShape>
fn effective_subchunk_shape(&self) -> Option<ChunkShape>
The effective subchunk shape.
The effective subchunk shape is the “read granularity” of the sharded array that accounts for array-to-array codecs preceding the sharding codec. For example, the transpose codec changes the shape of an array subset that corresponds to a single subchunk. The effective subchunk shape is used when determining the subchunk grid of a sharded array.
Returns None for an unsharded array of if the effective subchunk shape is indeterminate.
Sourcefn subchunk_grid(&self) -> ChunkGrid
fn subchunk_grid(&self) -> ChunkGrid
Retrieve the subchunk grid.
This uses the effective subchunk shape so that reading a subchunk reads only one contiguous byte range.
Returns the normal chunk grid for an unsharded array.
Sourcefn subchunk_grid_shape(&self) -> ArrayShape
fn subchunk_grid_shape(&self) -> ArrayShape
Return the shape of the subchunk grid (i.e., the number of subchunks).
Returns the normal chunk grid shape for an unsharded array.