Skip to main content

ArrayShardedExt

Trait ArrayShardedExt 

Source
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;
}
Available on crate feature sharding only.
Expand description

An Array extension trait to simplify working with arrays using the sharding_indexed codec.

Required Methods§

Source

fn is_sharded(&self) -> bool

Returns true if the array to bytes codec of the array is sharding_indexed.

Source

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.

Source

fn subchunk_shape(&self) -> Option<ChunkShape>

Return the subchunk shape as defined in the sharding_indexed codec metadata.

Returns None for an unsharded array.

Source

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.

Source

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.

Source

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.

Implementors§

Source§

impl<TStorage: ?Sized> ArrayShardedExt for Array<TStorage>