package index

  1. Overview
  2. Docs

Index

Index is a scalable implementation of persistent indices in OCaml.

Index provides the standard key-value interface: find, mem and replace. It requires three IO instances:

  • A `log` IO containing all of the recently-added bindings; this is also kept in memory.
  • When the `log` IO is full, it is merged into the `index` IO. Search is done first in `log` then in `index`, which makes recently added bindings search faster.
  • A `lock` IO to ensure safe concurrent access.
module Key : sig ... end
module Value : sig ... end
module type IO = sig ... end
module type SEMAPHORE = sig ... end

Binary semaphores for mutual exclusion

module type THREAD = sig ... end

Cooperative threads.

module Cache : sig ... end

Signatures and implementations of caches. Make requires a cache in order to provide instance sharing.

module type S = sig ... end

Index module signature.

exception RO_not_allowed

The exception raised when a write operation is attempted on a read_only index.

exception RW_not_allowed

The exception is raised when a sync operation is attempted on a read-write index.

exception Closed

The exception raised when any operation is attempted on a closed index, except for close, which is idempotent.

module Make (K : Key.S) (V : Value.S) (IO : IO) (_ : SEMAPHORE) (T : THREAD) (C : Cache.S) : S with type key = K.t and type value = V.t
module Stats : sig ... end

Run-time metric tracking for index instances.

module Checks : sig ... end

Offline integrity checking and recovery for Index stores.

module Private : sig ... end

These modules should not be used. They are exposed purely for testing purposes.

OCaml

Innovation. Community. Security.