Skip to content

Commit

Permalink
irmin-pack: add an explicit default value for indexing strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
craigfe committed Dec 23, 2021
1 parent 76b1fe6 commit 8eca001
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/irmin-pack/conf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module Default = struct
let readonly = false
let merge_throttle = `Block_writes
let freeze_throttle = `Block_writes
let indexing_strategy = Pack_store.Indexing_strategy.always
let indexing_strategy = Pack_store.Indexing_strategy.default
end

open Irmin.Backend.Conf
Expand Down
5 changes: 4 additions & 1 deletion src/irmin-pack/irmin_pack_intf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ module type Sigs = sig
the strategy to use when the index cache is full and an async
[Index.merge] in already in progress. [Block_writes] (the default)
blocks any new writes until the merge is completed. [Overcommit_memory]
does not block but indefinitely expands the in-memory cache. *)
does not block but indefinitely expands the in-memory cache.
@param indexing_strategy
The {{!Pack_store.Indexing_strategy} indexing strategy} of the backend
store. Defaults to {!Pack_store.Indexing_strategy.default}. *)

exception RO_not_allowed

Expand Down
2 changes: 2 additions & 0 deletions src/irmin-pack/pack_store.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ module Indexing_strategy = struct
indexed (as they may be referenced via hash by other V0 objects), and
this must be accounted for when reconstructing the index. *)
true

let default = always
end

module type S = S with type indexing_strategy := Indexing_strategy.t
Expand Down
5 changes: 5 additions & 0 deletions src/irmin-pack/pack_store_intf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ module type Sigs = sig
val minimal : t
(** The strategy that indexes as few objects as possible while still
maintaing store integrity. *)

val default : t
(** [default] is the indexing strategy used by [irmin-pack] instances that
do not explicitly set an indexing strategy in {!Irmin_pack.config}.
Currently set to {!always}. *)
end

module type S = S with type indexing_strategy := Indexing_strategy.t
Expand Down

0 comments on commit 8eca001

Please sign in to comment.