package irmin-pack
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=9e72efdc13324602d8da46e0492b1f4e09ad524149845e1a9106882f60ad6e1f
sha512=ae9cb4b086c7b93962aafc2ea339ac85c6d66bdf769f70a16f62fa5c74d9b194e12ac00b510be5ffac5adff3aa20fd69c4ca4067dcc966767fefcf5c02bc9969
doc/irmin-pack.unix/Irmin_pack_unix/Dispatcher/Make/argument-1-Fm/index.html
Parameter Make.Fm
Abstraction that governs the lifetime of the various files that are part of a pack store (except the branch store).
The file manager handles the files one by one and makes explicit all the interactions between them (except the index which is handled at a high level).
module Io = Io.Unix
module Control : Control_file.S with module Io = Io
Abstraction for irmin-pack's control file.
module Dict : Append_only_file.S with module Io = Io
Abstraction for irmin-pack's append only files (i.e. suffix and dict).
module Suffix : Append_only_file.S with module Io = Io
Abstraction for irmin-pack's append only files (i.e. suffix and dict).
module Index : sig ... end
An abstraction on top of the index library that exposes an API that better fits the irmin-pack use case.
module Errs : Io_errors.S with module Io = Io
module Mapping_file : Mapping_file.S with module Io = Io
val mapping : t -> Mapping_file.t option
type create_error := [
| Io.create_error
| Io.write_error
| Io.open_error
| Io.mkdir_error
| `Corrupted_mapping_file of string
| `Not_a_directory of string
| `Index_failure of string
]
val create_rw :
overwrite:bool ->
Irmin.Backend.Conf.t ->
(t, [> create_error ]) result
Note on SWMR consistency: It is undefined for a reader to attempt an opening before create_rw
is over.
Note on crash consistency: Crashing during create_rw
leaves the storage in an undefined state.
Note on errors: If create_rw
returns an error, the storage is left in an undefined state and some file descriptors might not be closed.
type open_rw_error := [
| `Corrupted_control_file
| `Corrupted_mapping_file of string
| `Double_close
| `Closed
| `File_exists of string
| `Index_failure of string
| `Invalid_argument
| `Invalid_layout
| `Io_misc of Control.Io.misc_error
| `Migration_needed
| `No_such_file_or_directory
| `Not_a_directory of string
| `Not_a_file
| `Read_out_of_bounds
| `Ro_not_allowed
| `Sys_error of string
| `V3_store_from_the_future
| `Only_minimal_indexing_strategy_allowed
| `Unknown_major_pack_version of string
| `Index_failure of string
| `Sys_error of string
| `Inconsistent_store
]
val open_rw : Irmin.Backend.Conf.t -> (t, [> open_rw_error ]) result
Note on SWMR consistency: It is undefined for a reader to attempt and opening during an open_rw
.
Note on crash consistency: If open_rw
crashes during open_rw_migrate_from_v1_v2
, the storage is left in an undefined state. Otherwise the storage is unaffected.
Note on errors: If open_rw
returns an error during open_rw_migrate_from_v1_v2
, the storage is left in an undefined state. Otherwise the storage is unaffected. Anyhow, some file descriptors might not be closed.
type open_ro_error := [
| `Corrupted_control_file
| `Corrupted_mapping_file of string
| `File_exists of string
| `Io_misc of Io.misc_error
| `Migration_needed
| `No_such_file_or_directory
| `Not_a_file
| `Closed
| `V3_store_from_the_future
| `Index_failure of string
| `Unknown_major_pack_version of string
| `Inconsistent_store
| `Invalid_argument
| `Read_out_of_bounds
| `Ro_not_allowed
]
val open_ro : Irmin.Backend.Conf.t -> (t, [> open_ro_error ]) result
Note on SWMR consistency: TODO: doc
Note on crash consistency: The storage is never mutated.
Note on errors: The storage is never mutated. Some file descriptors might not be closed.
type close_error := [
| `Double_close
| `Index_failure of string
| `Io_misc of Io.misc_error
| `Pending_flush
| `Ro_not_allowed
]
val close : t -> (unit, [> close_error ]) result
Close all the files.
This call fails if the append buffers are not in a flushed stated. This situation will most likely never occur because the append buffers will contain data only during the scope of a batch function.
After
type flush_error := [
| `Index_failure of string
| `Io_misc of Io.misc_error
| `Ro_not_allowed
| `Closed
]
val flush : ?hook:flush_stages hook -> t -> (unit, [> flush_error ]) result
val reload : ?hook:reload_stages hook -> t -> (unit, [> Errs.t ]) result
val register_suffix_consumer : t -> after_flush:(unit -> unit) -> unit
type version_error := [
| `Corrupted_control_file
| `Corrupted_legacy_file
| `Invalid_layout
| `Io_misc of Io.misc_error
| `No_such_file_or_directory
| `Not_a_directory of string
| `Unknown_major_pack_version of string
]
val version : root:string -> (Irmin_pack.Version.t, [> version_error ]) result
version ~root
is the version of the files at root
.
val swap :
t ->
generation:int ->
right_start_offset:Optint.Int63.t ->
right_end_offset:Optint.Int63.t ->
(unit, [> Errs.t ]) result
type write_gc_output_error := [
| `Double_close
| `File_exists of string
| `Io_misc of Io.misc_error
| `Ro_not_allowed
| `Closed
]
val write_gc_output :
root:string ->
generation:int ->
(Optint.Int63.t, Errs.t) result ->
(unit, [> write_gc_output_error ]) result
Used by the gc process at the end to write its output in store.<generation>.out.
val read_gc_output_error_t : read_gc_output_error Irmin.Type.t
val read_gc_output :
root:string ->
generation:int ->
(Optint.Int63.t, [> read_gc_output_error ]) result
Used by the main process, after the gc process finished, to read store.<generation>.out.
val readonly : t -> bool
val generation : t -> int
val gc_allowed : t -> bool