Conversation
normanrz
reviewed
Nov 17, 2021
| import zarr | ||
|
|
||
| store = zarr.DirectoryStore("data/chunking_test.zarr") | ||
| z = zarr.zeros((20, 3), chunks=(3, 3), shards=(2, 2), store=store, overwrite=True, compressor=None) |
Member
There was a problem hiding this comment.
shards is specified in units of chunks?
philippotto
reviewed
Nov 17, 2021
Member
philippotto
left a comment
There was a problem hiding this comment.
Looks very promising to me 👍
Author
|
Closing this, all further action is happening at the original zarr-developers repo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Internal only: Please provide any feedback you find, the below part is just the description for the PR on the official zarr repo.
This PR is for an early prototype of sharding support, as described in the corresponding issue TODO. It mainly be used to discuss the overall implementation approach for sharding. This PR is not meant to be merged.
This prototype
arr.zeros((20, 3), chunks=(3, 3), shards=(2, 2), …)).One shard corresponds to one storage key, but can contain multiple chunks:
.zarrayconfig and loaded when opening an array again,ShardedStoreclass that is used to wrap the chunk-store when sharding is enabled. This store handles the grouping of multiple chunks to one shard and transparently reads and writes them via the inner store. The original store API does not need to be adapted, it just stores shards instead of chunks, which are translated back to chunks byShardedStore.chunking_test.pyfor demonstration purposes, this will not be part of the final PR.If the overall direction of this PR is pursued, the following steps (and possibly more) are missing:
getitems,setitems&delitemson theShardedStore(also document such optimization possibilities on the
StoreorBaseStoreclass)Arraywhere possible (e.g. indigest&_resize_nosync)