package irmin-pack
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=11fc2570bdbfd48478c89113fc801084a84a9a2c12d9bf8c64e05ce64ae19bd7
sha512=2171699ca24dec5c9c908a2676b272e034c14eb17f7052a794535e52af0be40be68a689e59c0a640ee244b11703320483f4d0c261542e6242ba23a8f1272b9b0
doc/irmin-pack.unix/Irmin_pack_unix/Chunked_suffix/Make/index.html
Module Chunked_suffix.Make
Source
Abstraction for a chunked suffix. It is functionally equivalent to Append_only_file
but with a chunked implementation that is parameterized by
start_idx
forcreate_rw
to know the starting file name, andstart_idx
andchunk_num
for the open functions to know the starting file name and how many files there are.
Parameters
module Errs : Io_errors.S with module Io = Io
Signature
module Io = Io
module Errs = Errs
Abstraction for irmin-pack's append only files (i.e. suffix and dict).
type open_error = [
| Io.open_error
| `Closed
| `Invalid_argument
| `Inconsistent_store
| `Read_out_of_bounds
]
type add_new_error = [
| open_error
| Io.close_error
| `Pending_flush
| `File_exists of string
| `Multiple_empty_chunks
]
val create_rw :
root:string ->
start_idx:int ->
overwrite:bool ->
auto_flush_threshold:int ->
auto_flush_procedure:Ao.auto_flush_procedure ->
(t, [> create_error ]) result
val open_rw :
root:string ->
appendable_chunk_poff:Optint.Int63.t ->
start_idx:int ->
chunk_num:int ->
dead_header_size:int ->
auto_flush_threshold:int ->
auto_flush_procedure:Ao.auto_flush_procedure ->
(t, [> open_error ]) result
val open_ro :
root:string ->
appendable_chunk_poff:Optint.Int63.t ->
dead_header_size:int ->
start_idx:int ->
chunk_num:int ->
(t, [> open_error ]) result
val add_chunk :
auto_flush_threshold:int ->
auto_flush_procedure:Ao.auto_flush_procedure ->
t ->
(unit, [> add_new_error ]) result
appendable_chunk_poff t
is the number of bytes of the chunk file that is currently appendable. It does not perform IO.
RW mode
It also counts the bytes not flushed yet.
RO mode
This information originates from the latest reload of the control file. Calling refresh_appendable_chunk_poff t
updates appendable_chunk_poff
.
val refresh_appendable_chunk_poff :
t ->
Optint.Int63.t ->
(unit, [> `Rw_not_allowed ]) result
Ingest the new end offset of the appendable chunk file. Typically happens in RO mode when the control file has been re-read.
RW mode
Always returns Error `Rw_not_allowed
.
end_soff t
is the end offset for the chunked suffix. The valid range of offsets is 0 <= off < end_soff. Therefore, end_soff
also represents the length of the chunked suffix.
val fold_chunks :
(acc:'a ->
idx:int ->
start_suffix_off:Optint.Int63.t ->
end_suffix_off:Optint.Int63.t ->
is_appendable:bool ->
'a) ->
'a ->
t ->
'a