Block storage backed by files in nested directories. Each block is stored in
a separate file. File block stores may be constructed using the
file://<path-to-root>
URI form.
In many filesystems, performance degrades as the number of files in a directory grows. In order to reduce this impact and make navigating the blocks a bit more efficient, block files are stored in directories under the store root. All path elements are lower-case hex-encoded bytes from the multihash.
The directories under the root consist of the first four bytes of the multihashes of the blocks stored in them. Within each directory, blocks are stored in files whose names consist of the rest of their digests.
Thus, a block containing the content foobar
would have the sha1 digest
97df3501149...
and be stored under the root directory at:
root/111497df/35011497df3588b5a3...
This implementation tries to match the IPFS fs-repo behavior so that the on-disk representations remain compatible.
Block storage backed by files in nested directories. Each block is stored in a separate file. File block stores may be constructed using the `file://<path-to-root>` URI form. In many filesystems, performance degrades as the number of files in a directory grows. In order to reduce this impact and make navigating the blocks a bit more efficient, block files are stored in directories under the store root. All path elements are lower-case hex-encoded bytes from the multihash. The directories under the root consist of the first four bytes of the multihashes of the blocks stored in them. Within each directory, blocks are stored in files whose names consist of the rest of their digests. Thus, a block containing the content `foobar` would have the sha1 digest `97df3501149...` and be stored under the root directory at: `root/111497df/35011497df3588b5a3...` This implementation tries to match the IPFS fs-repo behavior so that the on-disk representations remain compatible.
(file-block-store root & {:as opts})
Creates a new local file-based block store.
Creates a new local file-based block store.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close