package irmin-pack
- Overview
- No Docs
You can search for identifiers within the package.
in-package search v0.2.0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=2a1e6a7577e498fbfeb678d666da210dc48d1344637e8ecb653e1dd88c640b5f
sha512=3fb6f49a1af2f8bab1df5b6f5affaaa09f09fe892a08eb2d9de58138e56646d4a6797f3c087b22875e36e3411218ab2435fe5437ac78f323dd661932af021fad
doc/irmin-pack.unix/Irmin_pack_unix/Pack_store/Make/argument-1-Fm/Suffix/index.html
Module Fm.Suffix
Abstraction for a chunked suffix. It is functionally equivalent to Append_only_file but with a chunked implementation that is parameterized by
start_idxforcreate_rwto know the starting file name, andstart_idxandchunk_numfor the open functions to know the starting file name and how many files there are.
module Io = Iomodule Errs : Io_errors.Smodule Ao : Append_only_file.SAbstraction for irmin-pack's append only files (i.e. suffix and dict).
type create_error = Io.create_errortype 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 ]) resultval 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 ]) resultval open_ro :
root:string ->
appendable_chunk_poff:Optint.Int63.t ->
dead_header_size:int ->
start_idx:int ->
chunk_num:int ->
(t, [> open_error ]) resultval add_chunk :
auto_flush_threshold:int ->
auto_flush_procedure:Ao.auto_flush_procedure ->
t ->
(unit, [> add_new_error ]) resultval start_idx : t -> intval chunk_num : t -> intval close : t -> (unit, [> Io.close_error | `Pending_flush ]) resultval empty_buffer : t -> boolval flush : t -> (unit, [> Io.write_error ]) resultval fsync : t -> (unit, [> Io.write_error ]) resultval appendable_chunk_poff : t -> Optint.Int63.tappendable_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 ]) resultIngest 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.
val end_soff : t -> Optint.Int63.tend_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 read_exn : t -> off:Optint.Int63.t -> len:int -> bytes -> unitval append_exn : t -> string -> unitval readonly : t -> boolval auto_flush_threshold : t -> int optionval 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