package irmin-pack
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=95a87ecc3dc2b35eee56cb351c32d2bd78c8967180a4b028324d815bfce1a6ff
sha512=20faba561c80c5389e91993d7e2cc0cedd1330cf098b68f0456f5068cde369a5589a05cd2aeb0a701d65a7d1e1e6f4045ccfbf60349cbea2bfd02981d7bb244c
doc/irmin-pack.unix/Irmin_pack_unix/File_manager/Make/index.html
Module File_manager.Make
Source
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).
Parameters
module Control : Control_file.S with module Io = Io.Unix
module Dict : Append_only_file.S with module Io = Control.Io
module Suffix : Append_only_file.S with module Io = Control.Io
module Index : sig ... end
module Errs : Errors.S with module Io = Control.Io
Signature
type create_error := [
| Io.create_error
| Io.write_error
| Io.open_error
| Io.mkdir_error
| `Not_a_directory of string
| `Index_failure of string
]
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
| `Double_close
| `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_on_closed
| `Read_out_of_bounds
| `Ro_not_allowed
| `Sys_error of string
| `V3_store_from_the_future
| `Write_on_closed
| `Index_failure of string
| `Unknown_major_pack_version of string
| `Inconsistent_store
]
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
| `File_exists of string
| `Io_misc of Io.misc_error
| `Migration_needed
| `No_such_file_or_directory
| `Not_a_file
| `Read_on_closed
| `V3_store_from_the_future
| `Index_failure of string
| `Unknown_major_pack_version of string
| `Inconsistent_store
| `Read_out_of_bounds
| `Invalid_argument
| `Inconsistent_store
]
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
]
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
| `Write_on_closed
]
type reload_error := [
| `Corrupted_control_file
| `Index_failure of string
| `Invalid_argument
| `Io_misc of Io.misc_error
| `Read_on_closed
| `Read_out_of_bounds
| `Rw_not_allowed
| `Unknown_major_pack_version of string
]
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
]
version ~root
is the version of the files at root
.