package octez-internal-libs

  1. Overview
  2. Docs
A package that contains some libraries used by the Octez suite

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65

doc/irmin_pack_unix/Irmin_pack_unix/File_manager/Make/Suffix/index.html

Module Make.SuffixSource

Abstraction for a chunked suffix. It is functionally equivalent to Append_only_file but with a chunked implementation that is parameterized by

  • start_idx for create_rw to know the starting file name, and
  • start_idx and chunk_num for the open functions to know the starting file name and how many files there are.
Sourcemodule Io = Io

Abstraction for irmin-pack's append only files (i.e. suffix and dict).

Sourcetype t
Sourcetype create_error = Io.create_error
Sourcetype open_error = [
  1. | Io.open_error
  2. | `Closed
  3. | `Invalid_argument
  4. | `Inconsistent_store
  5. | `Read_out_of_bounds
]
Sourcetype add_new_error = [
  1. | open_error
  2. | Io.close_error
  3. | `Pending_flush
  4. | `File_exists of string
  5. | `Multiple_empty_chunks
]
Sourceval create_rw : root:string -> start_idx:int -> overwrite:bool -> auto_flush_threshold:int -> auto_flush_procedure:Ao.auto_flush_procedure -> (t, [> create_error ]) Stdlib.result
Sourceval open_rw : root:string -> appendable_chunk_poff:Optint.Int63.t -> start_idx:int -> chunk_num:int -> dead_header_size:int -> auto_flush_threshold:int -> auto_flush_procedure:Ao.auto_flush_procedure -> (t, [> open_error ]) Stdlib.result
Sourceval open_ro : root:string -> appendable_chunk_poff:Optint.Int63.t -> dead_header_size:int -> start_idx:int -> chunk_num:int -> (t, [> open_error ]) Stdlib.result
Sourceval add_chunk : auto_flush_threshold:int -> auto_flush_procedure:Ao.auto_flush_procedure -> t -> (unit, [> add_new_error ]) Stdlib.result
Sourceval start_idx : t -> int
Sourceval chunk_num : t -> int
Sourceval close : t -> (unit, [> Io.close_error | `Pending_flush ]) Stdlib.result
Sourceval empty_buffer : t -> bool
Sourceval flush : t -> (unit, [> Io.write_error ]) Stdlib.result
Sourceval fsync : t -> (unit, [> Io.write_error ]) Stdlib.result
Sourceval appendable_chunk_poff : t -> Optint.Int63.t

appendable_chunk_poff t is the number of bytes of the chunk file that is currently appendable. It does not perform IO.

RW mode

It also counts the bytes not flushed yet.

RO mode

This information originates from the latest reload of the control file. Calling refresh_appendable_chunk_poff t updates appendable_chunk_poff.

Sourceval refresh_appendable_chunk_poff : t -> Optint.Int63.t -> (unit, [> `Rw_not_allowed ]) Stdlib.result

Ingest the new end offset of the appendable chunk file. Typically happens in RO mode when the control file has been re-read.

RW mode

Always returns Error `Rw_not_allowed.

Sourceval end_soff : t -> Optint.Int63.t

end_soff t is the end offset for the chunked suffix. The valid range of offsets is 0 <= off < end_soff. Therefore, end_soff also represents the length of the chunked suffix.

Sourceval read_exn : t -> off:Optint.Int63.t -> len:int -> bytes -> unit
Sourceval read_range_exn : t -> off:Optint.Int63.t -> min_len:int -> max_len:int -> bytes -> int
Sourceval append_exn : t -> string -> unit
Sourceval readonly : t -> bool
Sourceval auto_flush_threshold : t -> int option
Sourceval fold_chunks : (acc:'a -> idx:int -> start_suffix_off:Optint.Int63.t -> end_suffix_off:Optint.Int63.t -> is_appendable:bool -> 'a) -> 'a -> t -> 'a
OCaml

Innovation. Community. Security.