]> git.ipfire.org Git - thirdparty/git.git/commit
reftable: add blocksource, an abstraction for random access reads
authorHan-Wen Nienhuys <hanwen@google.com>
Thu, 7 Oct 2021 20:25:01 +0000 (20:25 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 8 Oct 2021 17:45:48 +0000 (10:45 -0700)
commit1214aa841bc825c97541a68f397227cb2bfd3f3c
tree782222593af1c28bbefd31058460aec0b3aa6107
parentef8a6c62687984f2562463286e60ec1c66242b5c
reftable: add blocksource, an abstraction for random access reads

The reftable format is usually used with files for storage. However, we abstract
away this using the blocksource data structure. This has two advantages:

* log blocks are zlib compressed, and handling them is simplified if we can
  discard byte segments from within the block layer.

* for unittests, it is useful to read and write in-memory. The blocksource
  allows us to abstract the data away from on-disk files.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
reftable/blocksource.c [new file with mode: 0644]
reftable/blocksource.h [new file with mode: 0644]
reftable/reftable-blocksource.h [new file with mode: 0644]