Skip to content

CP-307947: [maintenance]: add .mli files to all database modules #6460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ocaml/database/block_device_io.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(* this file is empty on purpose: this is an executable file *)
19 changes: 19 additions & 0 deletions ocaml/database/block_device_io_errors.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(*
* Copyright (C) Cloud Software Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; version 2.1 only. with the special
* exception on linking described in file LICENSE.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*)

val timeout_error_msg : string

val not_enough_space_error_msg : string

val not_initialised_error_msg : string
1 change: 1 addition & 0 deletions ocaml/database/database_server_main.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(* this file is empty on purpose: this is an executable file *)
11 changes: 0 additions & 11 deletions ocaml/database/db_action_helper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,5 @@ let __callback :

let events_register f = __callback := Some f

let events_unregister () = __callback := None

let events_notify ?snapshot ty op ref =
match !__callback with None -> () | Some f -> f ?snapshot ty op ref

(*
exception Db_set_or_map_parse_fail of string

let parse_sexpr s : SExpr.t list =
match SExpr_TS.of_string s with
| SExpr.Node xs -> xs
| _ -> raise (Db_set_or_map_parse_fail s)
*)
18 changes: 18 additions & 0 deletions ocaml/database/db_action_helper.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
(*
* Copyright (C) Cloud Software Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; version 2.1 only. with the special
* exception on linking described in file LICENSE.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*)

val events_register :
(?snapshot:Rpc.t -> string -> string -> string -> unit) -> unit

val events_notify : ?snapshot:Rpc.t -> string -> string -> string -> unit
17 changes: 17 additions & 0 deletions ocaml/database/db_cache.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(*
* Copyright (C) Cloud Software Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; version 2.1 only. with the special
* exception on linking described in file LICENSE.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*)

val get : Db_ref.t -> (module Db_interface.DB_ACCESS)

val apply_delta_to_cache : Redo_log.t -> Db_ref.t -> unit
1 change: 1 addition & 0 deletions ocaml/database/db_cache_test.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(* this file is empty on purpose: this is an executable file *)
29 changes: 29 additions & 0 deletions ocaml/database/db_connections.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
(*
* Copyright (C) Cloud Software Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; version 2.1 only. with the special
* exception on linking described in file LICENSE.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*)

val get_dbs_and_gen_counts : unit -> (int64 * Parse_db_conf.db_connection) list

val choose :
Parse_db_conf.db_connection list -> Parse_db_conf.db_connection option

val preferred_write_db : unit -> Parse_db_conf.db_connection

val exit_on_next_flush : bool ref

val inc_db_flush_thread_refcount : unit -> unit

val flush_dirty_and_maybe_exit :
Parse_db_conf.db_connection -> int option -> bool

val flush : Parse_db_conf.db_connection -> Db_cache_types.Database.t -> unit
39 changes: 39 additions & 0 deletions ocaml/database/db_exn.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
(*
* Copyright (C) Cloud Software Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; version 2.1 only. with the special
* exception on linking described in file LICENSE.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*)

(** class * field * uuid * key *)
exception Duplicate_key of string * string * string * string

(** message * class * key *)
exception DBCache_NotFound of string * string * string

(** class * field * key *)
exception Uniqueness_constraint_violation of string * string * string

(** class * field * value *)
exception Integrity_violation of string * string * string

(** class * _ * uuid *)
exception Read_missing_uuid of string * string * string

(** class * _ * uuid *)
exception Too_many_values of string * string * string

exception Remote_db_server_returned_unknown_exception

exception Remote_db_server_returned_bad_message

exception Empty_key_in_map

exception Invalid_value
27 changes: 0 additions & 27 deletions ocaml/database/db_filter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,6 @@

open Db_filter_types

let string_of_val = function
| Field x ->
"Field " ^ x
| Literal x ->
"Literal " ^ x

let rec string_of_expr =
let binexpr name a b =
Printf.sprintf "%s (%s, %s)" name (string_of_expr a) (string_of_expr b)
in
let binval name a b =
Printf.sprintf "%s (%s, %s)" name (string_of_val a) (string_of_val b)
in
function
| True ->
"True"
| False ->
"False"
| Not x ->
Printf.sprintf "Not ( %s )" (string_of_expr x)
| And (a, b) ->
binexpr "And" a b
| Or (a, b) ->
binexpr "Or" a b
| Eq (a, b) ->
binval "Eq" a b

exception XML_unmarshall_error

let val_of_xml xml =
Expand Down
25 changes: 25 additions & 0 deletions ocaml/database/db_filter.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
(*
* Copyright (C) Cloud Software Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; version 2.1 only. with the special
* exception on linking described in file LICENSE.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*)

exception XML_unmarshall_error

exception Expression_error of (string * exn)

val expr_of_xml : XMLRPC.xmlrpc -> Db_filter_types.expr

val expr_of_string : string -> Db_filter_types.expr

val xml_of_expr : Db_filter_types.expr -> XMLRPC.xmlrpc

val eval_expr : (Db_filter_types._val -> string) -> Db_filter_types.expr -> bool
15 changes: 15 additions & 0 deletions ocaml/database/db_filter_lex.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(*
* Copyright (C) Cloud Software Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; version 2.1 only. with the special
* exception on linking described in file LICENSE.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*)

val lexer : Lexing.lexbuf -> Db_filter_parse.token
31 changes: 31 additions & 0 deletions ocaml/database/db_filter_types.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
(*
* Copyright (C) Cloud Software Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; version 2.1 only. with the special
* exception on linking described in file LICENSE.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*)

type _val = Field of string | Literal of string

val rpc_of__val : _val -> Rpc.t

val _val_of_rpc : Rpc.t -> _val

type expr =
| True
| False
| Not of expr
| Eq of _val * _val
| And of expr * expr
| Or of expr * expr

val rpc_of_expr : expr -> Rpc.t

val expr_of_rpc : Rpc.t -> expr
67 changes: 67 additions & 0 deletions ocaml/database/db_globs.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
(*
* Copyright (C) Cloud Software Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; version 2.1 only. with the special
* exception on linking described in file LICENSE.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*)

val redo_log_block_device_io : string ref

val redo_log_connect_delay : float ref

val redo_log_max_block_time_empty : float ref

val redo_log_max_block_time_read : float ref

val redo_log_max_block_time_writedelta : float ref

val redo_log_max_block_time_writedb : float ref

val redo_log_initial_backoff_delay : int

val redo_log_exponentiation_base : int

val redo_log_maximum_backoff_delay : int

val redo_log_max_dying_processes : int

val redo_log_comms_socket_stem : string

val redo_log_max_startup_time : float ref

val redo_log_length_of_half : int

val ha_metadata_db : string

val gen_metadata_db : string

val static_vdis_dir : string ref

val http_limit_max_rpc_size : int

val idempotent_map : bool ref

val permanent_master_failure_retry_interval : float ref

val master_connection_reset_timeout : float ref

val master_connection_retry_timeout : float ref

val master_connection_default_timeout : float ref

val pool_secret : Db_secret_string.t ref

val restart_fn : (unit -> unit) ref

val https_port : int ref

val snapshot_db : string

val db_conf_path : string ref
File renamed without changes.
Loading
Loading