diff --git a/brassaia/index/src/data.ml b/brassaia/index/src/data.ml index b35f9909ac99b6b77ba365364f5d6de2ad88038b..c6e25865fc6901ccaca6ed57d542b5e7ee0e5023 100644 --- a/brassaia/index/src/data.ml +++ b/brassaia/index/src/data.ml @@ -16,7 +16,7 @@ module type Key = sig val hash_size : int (** The number of bits necessary to encode the maximum output value of - {!hash}. `Hashtbl.hash` uses 30 bits. + [hash]. [Hashtbl.hash] uses 30 bits. Overestimating the [hash_size] will result in performance drops; underestimation will result in undefined behavior. *) diff --git a/brassaia/index/src/index_intf.ml b/brassaia/index/src/index_intf.ml index 737db81c037e8f841ff62fcb6fd9922f9014ccd7..e09575b32ba0d9f01f85247ba3238db34a35a6ba 100644 --- a/brassaia/index/src/index_intf.ml +++ b/brassaia/index/src/index_intf.ml @@ -124,11 +124,11 @@ module type S = sig val sync : t -> unit (** [sync t] syncs a read-only index with the files on disk. Raises - {!RW_not_allowed} if called by a read-write index. *) + [RW_not_allowed] if called by a read-write index. *) val is_merging : t -> bool (** [is_merging t] returns true if [t] is running a merge. Raises - {!RO_not_allowed} if called by a read-only index. *) + [RO_not_allowed] if called by a read-only index. *) val merge : t -> unit (** [merge t] forces a merge for [t]. @@ -141,7 +141,7 @@ module type S = sig returns. *) val try_merge : t -> unit - (** [try_merge] is like {!merge} but is a no-op if the number of entries in + (** [try_merge] is like [merge] but is a no-op if the number of entries in the write-ahead log is smaller than [log_size]. *) (** Offline [fsck]-like utility for checking the integrity of Index stores @@ -185,7 +185,7 @@ module type Private = sig key -> value -> merge_result async option - (** [replace' t k v] is like {!replace t k v} but returns a promise of a merge + (** [replace' t k v] is like [replace t k v] but returns a promise of a merge result if the {!replace} call triggered one. *) val close' : hook:[ `Abort_signalled ] hook -> ?immediately:unit -> t -> unit diff --git a/brassaia/index/src/platform.ml b/brassaia/index/src/platform.ml index 99a493956bea62a980d95437a41c7f0b22c125b3..728019159bd39c133a6e4c90a93a63b7ef63da35 100644 --- a/brassaia/index/src/platform.ml +++ b/brassaia/index/src/platform.ml @@ -1,7 +1,7 @@ module type IO = Io.S module type CLOCK = sig - (** A monotonic time source. See {!Mtime_clock} for an OS-dependent + (** A monotonic time source. See [Mtime_clock] for an OS-dependent implementation. *) type counter diff --git a/brassaia/index/src/unix/dune b/brassaia/index/src/unix/dune index d12c5aa52b3031b7ee030cc039a249bad50fd6ac..1f7fe727f7344d39ec649351e7578875e3bb9670 100644 --- a/brassaia/index/src/unix/dune +++ b/brassaia/index/src/unix/dune @@ -12,7 +12,7 @@ fmt.tty lwt lwt.unix - index + octez-libs.brassaia.index semaphore-compat) (flags (:standard) diff --git a/brassaia/index/src/unix/index_unix.ml b/brassaia/index/src/unix/index_unix.ml index 379530314f32b4a17ddde788cc5ba50363ac7c20..c604a45ccf72dea918654dd449fe1fcc7852ab46 100644 --- a/brassaia/index/src/unix/index_unix.ml +++ b/brassaia/index/src/unix/index_unix.ml @@ -25,9 +25,9 @@ exception RO_not_allowed let current_version = "00000001" -module Stats = Index.Stats +module Stats = Brassaia_index.Index.Stats -module IO : Index.Platform.IO = struct +module IO : Brassaia_index.Index.Platform.IO = struct let ( ++ ) = Int63.add let ( -- ) = Int63.sub @@ -421,8 +421,8 @@ module Platform = struct module Fmt_tty = Fmt_tty end -module Make (K : Index.Key.S) (V : Index.Value.S) = - Index.Make (K) (V) (Platform) +module Make (K : Brassaia_index.Index.Key.S) (V : Brassaia_index.Index.Value.S) = + Brassaia_index.Index.Make (K) (V) (Platform) module Syscalls = Syscalls @@ -431,6 +431,8 @@ module Private = struct module IO = IO module Raw = Raw - module Make (K : Index.Key.S) (V : Index.Value.S) = - Index.Private.Make (K) (V) (Platform) + module Make + (K : Brassaia_index.Index.Key.S) + (V : Brassaia_index.Index.Value.S) = + Brassaia_index.Index.Private.Make (K) (V) (Platform) end diff --git a/brassaia/index/src/unix/index_unix.mli b/brassaia/index/src/unix/index_unix.mli index a6d8ffec802f11635a455bd910272d31264a7a6b..b598561175c66d9145c4f45f91aa44cd8c2072b5 100644 --- a/brassaia/index/src/unix/index_unix.mli +++ b/brassaia/index/src/unix/index_unix.mli @@ -16,6 +16,7 @@ all copies or substantial portions of the Software. *) open! Import +open Brassaia_index module Make (K : Index.Key.S) (V : Index.Value.S) (C : Index.Cache.S) : Index.S with type key = K.t and type value = V.t @@ -26,8 +27,8 @@ module Syscalls = Syscalls (** These modules should not be used. They are exposed purely for testing purposes. *) module Private : sig - module Platform : Index.Platform.S - module IO : Index.Platform.IO + module Platform : Brassaia_index.Platform.S + module IO : Brassaia_index.Platform.IO module Raw = Raw module Make (K : Index.Key.S) (V : Index.Value.S) (C : Index.Cache.S) : diff --git a/brassaia/index/src/unix/raw.ml b/brassaia/index/src/unix/raw.ml index f3f52643b375b2cfa2629583cc7bc5f8e1ee0a96..f75678be0bc80541b3a4fdd1601098ca0a7a72ee 100644 --- a/brassaia/index/src/unix/raw.ml +++ b/brassaia/index/src/unix/raw.ml @@ -1,5 +1,5 @@ open! Import -module Stats = Index.Stats +module Stats = Brassaia_index.Index.Stats let ( ++ ) = Int63.add diff --git a/brassaia/lib_brassaia_pack/unix/io.ml b/brassaia/lib_brassaia_pack/unix/io.ml index 254218c7fbfe7fdeaf2387933972144b7bad17cb..1d88b718f9feb6c08993b42c57a2a0411fa72c7c 100644 --- a/brassaia/lib_brassaia_pack/unix/io.ml +++ b/brassaia/lib_brassaia_pack/unix/io.ml @@ -15,6 +15,7 @@ *) open! Import +open Brassaia_index module Syscalls = Brassaia_index_unix.Index_unix.Syscalls (* File utils, taken from index.unix package. diff --git a/brassaia/lib_brassaia_pack/unix/pack_index.ml b/brassaia/lib_brassaia_pack/unix/pack_index.ml index 5786ed923993c86930f3b19bc51f9aba163d2921..0e05343cb5ac880f29be16fdefb7db2f7663cbce 100644 --- a/brassaia/lib_brassaia_pack/unix/pack_index.ml +++ b/brassaia/lib_brassaia_pack/unix/pack_index.ml @@ -58,10 +58,13 @@ module Make (K : Brassaia.Hash.S) = struct (off, len, kind) end - module Stats = Index.Stats - module I = Index + module Stats = Brassaia_index.Index.Stats + module I = Brassaia_index.Index open Brassaia_index_unix - module Index = Index_unix.Make (Key) (Val) (Index.Cache.Unbounded) + + module Index = + Index_unix.Make (Key) (Val) (Brassaia_index.Index.Cache.Unbounded) + include Index module Io = Io.Unix diff --git a/brassaia/lib_brassaia_pack/unix/pack_index_intf.ml b/brassaia/lib_brassaia_pack/unix/pack_index_intf.ml index 37b035b7b8088bb1da0ebe62a860048485bd4872..2c7ca7c08f4d96b41508c8c2e1fd243f20c1f553 100644 --- a/brassaia/lib_brassaia_pack/unix/pack_index_intf.ml +++ b/brassaia/lib_brassaia_pack/unix/pack_index_intf.ml @@ -24,7 +24,12 @@ module type S = sig type key type value = int63 * int * Pack_value.Kind.t - include Index.S with type value := value and type t := t and type key := key + include + Brassaia_index.Index.S + with type value := value + and type t := t + and type key := key + module Io = Io.Unix val init_exn : @@ -64,8 +69,8 @@ module type S = sig val filter : t -> (key * value -> bool) -> unit val try_merge : t -> unit - module Stats = Index.Stats - module Key : Index.Key.S with type t = key + module Stats = Brassaia_index.Index.Stats + module Key : Brassaia_index.Index.Key.S with type t = key end module type Sigs = sig diff --git a/brassaia/lib_brassaia_pack/unix/snapshot.ml b/brassaia/lib_brassaia_pack/unix/snapshot.ml index 7ef15e7a3444f159e6ceab502d016864050b67cd..fd561f9abb6258563b2efa518726f719ea1facb5 100644 --- a/brassaia/lib_brassaia_pack/unix/snapshot.ml +++ b/brassaia/lib_brassaia_pack/unix/snapshot.ml @@ -46,7 +46,7 @@ module Make (Args : Args) = struct module Index = Brassaia_index_unix.Index_unix.Make (Pack_index.Key) (Value_unit) - (Index.Cache.Unbounded) + (Brassaia_index.Index.Cache.Unbounded) type t = { file_manager : File_manager.t; @@ -249,7 +249,7 @@ module Make (Args : Args) = struct module Index = Brassaia_index_unix.Index_unix.Make (Pack_index.Key) (Value) - (Index.Cache.Unbounded) + (Brassaia_index.Index.Cache.Unbounded) type path = string diff --git a/brassaia/lib_brassaia_pack/unix/stats.ml b/brassaia/lib_brassaia_pack/unix/stats.ml index e73a8193a6abcbdff0e16f8ad11faa4800c0e60f..79e68e0abc2c59aeff3b0d9c09184e1ac4beace4 100644 --- a/brassaia/lib_brassaia_pack/unix/stats.ml +++ b/brassaia/lib_brassaia_pack/unix/stats.ml @@ -111,7 +111,7 @@ module Index = struct let clear (data : stat) = let s = Metrics.state data in - Index.Stats.reset_stats (); + Brassaia_index.Index.Stats.reset_stats (); s.bytes_read <- 0; s.nb_reads <- 0; s.bytes_written <- 0; diff --git a/brassaia/lib_brassaia_pack/unix/stats_intf.ml b/brassaia/lib_brassaia_pack/unix/stats_intf.ml index 8c030cfccf69cb16b6946f28a70ceee87428624a..a71da38e7a1ec0a405f56258ee2d892bd3109054 100644 --- a/brassaia/lib_brassaia_pack/unix/stats_intf.ml +++ b/brassaia/lib_brassaia_pack/unix/stats_intf.ml @@ -15,6 +15,7 @@ *) open Import +open Brassaia_index module Pack_store = struct type field = diff --git a/manifest/product_octez.ml b/manifest/product_octez.ml index de5c5229f01497f2b67e7717fd47221ea50d464e..7999eeed3e5c9da21dc865ec224a11b8c7ffdbda 100644 --- a/manifest/product_octez.ml +++ b/manifest/product_octez.ml @@ -2192,7 +2192,16 @@ let brassaia_index_unix = "brassaia.index.unix" ~path:"brassaia/index/src/unix" ~deps: - [optint; mtime; rusage; fmt_tty; lwt; lwt_unix; index; semaphore_compat] + [ + optint; + mtime; + rusage; + fmt_tty; + lwt; + lwt_unix; + brassaia_index; + semaphore_compat; + ] ~flags:(Flags.standard ~disable_warnings:[66; 68] ()) ~foreign_stubs: {language = C; flags = []; include_dirs = []; names = ["pread"; "pwrite"]} diff --git a/opam/octez-libs.opam b/opam/octez-libs.opam index 2137a25adc51deacf396a2c070741af09f0b5b01..7b145f6fa935a787db7f0ed841b971ce1548eee2 100644 --- a/opam/octez-libs.opam +++ b/opam/octez-libs.opam @@ -74,7 +74,6 @@ depends: [ "optint" "rusage" "lru" { >= "0.3.0" } - "index" { >= "1.6.0" & < "1.7.0" } "semaphore-compat" { >= "1.0.1" } "checkseum" { != "0.5.0" } "ringo" { >= "1.1.0" } diff --git a/src/lib_context_brassaia/disk/context.ml b/src/lib_context_brassaia/disk/context.ml index 450387e99c47b1fef04d9180631e37e55ce5e1f1..581caa95b09256b4a870b00808b6568a7f5ddcb6 100644 --- a/src/lib_context_brassaia/disk/context.ml +++ b/src/lib_context_brassaia/disk/context.ml @@ -45,7 +45,7 @@ module type TEZOS_CONTEXT_UNIX = sig module Checks : sig module Pack : Brassaia_pack_unix.Checks.S - module Index : Index.Checks.S + module Index : Brassaia_index.Index.Checks.S end end diff --git a/src/lib_context_brassaia/disk/context.mli b/src/lib_context_brassaia/disk/context.mli index 997a2fb9a64cc2ec0fd38b0d2f75962e3922c524..bb0d2e23279f51922acdf634e75a2f375124459f 100644 --- a/src/lib_context_brassaia/disk/context.mli +++ b/src/lib_context_brassaia/disk/context.mli @@ -46,7 +46,7 @@ module type TEZOS_CONTEXT_UNIX = sig module Checks : sig module Pack : Brassaia_pack_unix.Checks.S - module Index : Index.Checks.S + module Index : Brassaia_index.Index.Checks.S end end