@@ -77,9 +77,8 @@ introduced with the words "for example".
7777Configuration parameters
7878========================
7979
80- Sharding can be configured per array in the :ref: `array-metadata ` as follows:
80+ Sharding can be configured per array in the :ref: `array-metadata ` as follows::
8181
82- .. code-block ::
8382 {
8483 codecs: [
8584 {
@@ -129,12 +128,12 @@ referencing them. The index is placed at the end of the file and has a size of
129128``16 bytes * 4 = 1024 bytes `` for shard shape of ``[64, 64] `` and inner chunk
130129shape of ``[32, 32] ``. The index holds an `offset, nbytes ` pair of little-endian
131130uint64 per chunk, the chunks-order in the index is row-major (C) order. Given
132- the example of 2x2 inner chunks in a shard, the index would look like:
131+ the example of 2x2 inner chunks in a shard, the index would look like::
133132
134- .. code-block ::
135133 | chunk (0, 0) | chunk (0, 1) | chunk (1, 0) | chunk (1, 1) |
136134 | offset | nbytes | offset | nbytes | offset | nbytes | offset | nbytes |
137135 | uint64 | uint64 | uint64 | uint64 | uint64 | uint64 | uint64 | uint64 |
136+
138137Empty chunks are denoted by setting both offset and nbytes to ``2^64 - 1 ``.
139138Empty chunks are interpreted as being filled with the fill value. The index
140139always has the full shape of all possible chunks per shard, even if they extend
@@ -177,7 +176,7 @@ common optimizations.
177176 relevant bytes that belong to the requested chunk. The relevant bytes are
178177 determined by the `offset,nbytes ` pair in the shard index. This bytestream
179178 then needs to be decoded with the inner codecs as specified in the sharding
180- configuration applying the :ref: `_decoding_procedure `. This is similar to how
179+ configuration applying the :ref: `decoding_procedure `. This is similar to how
181180 an implementation would access a sub-slice of a chunk.
182181
183182 When reading all chunks of a shard at once, a useful optimization would be to
@@ -192,7 +191,7 @@ common optimizations.
192191 bytestream, then, needs to be decoded as above.
193192
194193* **Encoding **: A simple implementation to encode a chunk in a shard would (a)
195- encode the new chunk per :ref: `_encoding_procedure ` in a byte buffer using the
194+ encode the new chunk per :ref: `encoding_procedure ` in a byte buffer using the
196195 shard's inner codecs, (b) read an existing shard from the store, (c) create a
197196 new bytestream with all encoded chunks of that shard including the overwritten
198197 chunk, (d) generate a new shard index that is appended to the chunk bytestream
0 commit comments