package irmin-pack
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=cd788a8d3f4a3dd18dc160a153d4aec91eaf6b0fb41ad41464d26c79c304a98e
sha512=4f97862678d35e0b4aa814a1df51d6f8c59bcf5b611c73f0a475f9b5386ca42a4a18e65ce80fc425ddad93fcdacfcb563c52f6423777610a0bc567902f4db088
doc/irmin-pack.unix/Irmin_pack_unix/Checks/Make/argument-1-_/Gc/index.html
Module _.Gc
GC
The state of the GC process after calling finalise_exn
Low-level API
val start_exn : ?unlink:bool -> repo -> commit_key -> bool Lwt.t
start_exn
tries to start the GC process and returns true if the GC is launched. If a GC is already running, a new one is not started.
The GC process will not be automatically finalised. The caller is responsible for calling finalise_exn
.
If unlink
is false then temporary files and files from the previous generation will be kept on disk after the GC finished. This option is useful for debugging. The default is true
.
TODO: Detail exceptions raised.
val finalise_exn : ?wait:bool -> repo -> process_state Lwt.t
finalise_exn ?wait repo
waits for the GC process to finish in order to finalise it. It returns the state of the GC process from the point of view of the function call; subsequent calls of finalise_exn
after a return of `Finalised
will return `Idle
.
Finalising consists of mutating repo
so that it points to the new file and to flush the internal caches that could be referencing GCed objects.
If wait = true
(the default), the call blocks until the GC process finishes. If wait = false
, finalisation will occur if the process has ended.
If there are no running GCs, the call is a no-op and it returns `Idle
.
TODO: Detail exceptions raised.
High-level API
Pretty-print error messages meant for informational purposes, like logging
val run :
?finished:((Stats.Latest_gc.stats, msg) result -> unit Lwt.t) ->
repo ->
commit_key ->
(bool, msg) result Lwt.t
run repo commit_key
attempts to start a GC process for a repo
by discarding all data prior to commit_key
. If a GC process is already running, a new one will not be started.
run
will also finalise the GC process automaticlly. For more detailed control, see start_exn
and finalise_exn
.
When the GC process is finalised, finished
is called with the result of finalisation.
To monitor progress of GC, see wait
or is_finished
.
Returns whether a GC process successfully started or not.
All exceptions that Irmin_pack
knows how to handle are caught and returned as pretty-print error messages; others are re-raised. The error messages should be used only for informational purposes, like logging.
val wait : repo -> (Stats.Latest_gc.stats option, msg) result Lwt.t
wait repo
blocks until GC is finished or is idle.
If a GC finalises, its stats are returned.
All exceptions that Irmin_pack
knows how to handle are caught and returned as pretty-print error messages; others are re-raised. The error messages should be used only for informational purposes, like logging.
val cancel : repo -> bool
cancel repo
aborts the current GC and returns true
, or returns false
if no GC was running.
val is_finished : repo -> bool
is_finished repo
is true
if a GC is finished (or idle) and false
if a GC is running for the given repo
.
val is_allowed : repo -> bool
is_allowed repo
returns true if a gc can be run on the store.
val latest_gc_target : repo -> commit_key option
latest_gc_target
returns the commit key on which the latest, finished gc was called on.