Skip to content
This repository
tag: v996
Fetching contributors…

Cannot retrieve contributors at this time

file 91 lines (71 sloc) 2.651 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
(*
Copyright © 2011 MLstate

This file is part of OPA.

OPA is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License, version 3, as published by
the Free Software Foundation.

OPA 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 Affero General Public License for
more details.

You should have received a copy of the GNU Affero General Public License
along with OPA. If not, see <http://www.gnu.org/licenses/>.
*)
type t

val create : [< `append | `create | `readonly ] -> string -> t
val close : t -> unit

(** Return database location *)
val get_location : t -> string
val is_uidfile_existing : string -> bool
val is_open : t -> bool
val output_dot : t -> int (* rev *) -> string (* content *) -> unit

(** Seek some file to 0 (in & out).
* Used by databae orruption manager *)
val rebirth : t -> unit

(* Lock File *)
val lock_file : t -> bool

(** write config file *)
val write_config : t -> DbTypes.configfile -> unit
(** write only the revision of the last snapshot in Config file *)
val write_config_last_snapshot : t -> DbTypes.rev -> unit
val read_config : t -> DbTypes.configfile
val write_version : t -> int -> unit
val read_version : t -> int

val write_flags : t -> unit
val overwrite_flags:
  ?uidr:DbTypes.position ->
  ?node:DbTypes.position ->
  ?trans:DbTypes.position ->
  ?tms:DbTypes.position ->
  uid:DbTypes.uid ->
  rev:DbTypes.rev ->
  t ->
  unit

val write_timestamp : t -> Time.t -> unit
val read_timestamp : t -> int -> Time.t

val write_uid_rev : t -> DbTypes.uidrevfile -> unit
val read_uid_rev : ?rev:DbTypes.rev -> t -> DbTypes.uidrevfile

val write_dbstate :
  ?reset:bool ->
  t ->
  uidmap: DbTypes.uidmap ->
  index: DbTypes.index ->
  unit

val read_dbstate : t -> DbTypes.dbstate

val write_nodes : t -> ?last_uid:DbTypes.uid -> Node.t Uid.Map.t -> unit
val overwrite_nodes : t -> Node.t Uid.Map.t -> unit
val read_nodes : t -> DbTypes.nodefile
val read_specific_node : t -> DbTypes.uid -> Node.t

(*
FIXME: option ?
*)
val write_trans : t -> DbTypes.trans option -> unit
(*val read_trans : t -> trans*)
val read_transs : t -> DbTypes.transfile

val get_filemanager : t -> DbIo.t

(* do a backup of db's files *)
val do_backup : t -> unit

(* Return last uid rev available. Given flags, restore file or not. *)
val restore_uidrev : restore:bool -> t -> DbTypes.uidrevfile option

(* Clean temporary hashtables, used for opening the db *)
val cleanup_hashtbls : unit -> unit
Something went wrong with that request. Please try again.