Module type Seqdb_containers.PERM


module type PERM = sig .. end
Output type of Perm

type t 
The perm file
type entry 
A live entry in a perm file
module Container: Seqdb_containers.HASHABLE 
The permuted container
val create : ?sbsize:int ->
?hash_algo:Seqdb_containers.Hash_algo.hash_algo ->
?fileincr:int64 ->
?purpose:string ->
Container.t -> Seqdb_rdwr.file_descr -> t
Write an empty perm structure into the file referenced by the file descriptor.
val access : Container.t -> Seqdb_rdwr.file_descr -> t
Access the perm file referenced by the file descriptor
val superblock : t -> Seqdb_containers.Superblock.t
Get the superblock
val mark_superblock_as_dirty : t -> unit
The superblock is marked as dirty, and will be written out at the next good opportunity
val configure : ?flush_every:int -> ?auto_fadvise:bool -> t -> unit
Sets some (non-persistent) parameters:
val size : t -> int64
The size of the permutation array in number of entries
val add : t -> Container.entry -> entry
Adds a new entry at the end of the permutation array

It isn't checked whether the Container.pointer is already member of the array!

val flush : t -> unit
Ensure that everything is written out (but a sync is not forced). Furthermore, it is ensured that all file descriptors are forgotten about.
val sync : t -> unit
Ensure that everything is physically written to disk (implies flush)
val get_contents : entry -> Container.entry
Get the contents of an entry
val get_index : entry -> int64
Get the index of an entry, 0 <= index < size
val lookup : t -> int64 -> entry
Get an entry by looking up an index, 0 <= index < size
val group : ?ext:Seqdb_rdwr.file_descr * int -> t -> unit
Sorts the entries by first their hash value, and then by their keys. The result is a perm array where all entries for a key are adjacent.

ext: If passed as (fd, n), an external sort is used with a chunk size of n (i.e. up to n entries are sorted in memory). fd is a file that serves as scratch space.

EXTERNAL SORTING IS NOT YET IMPLEMENTED!

val hash_algo : t -> Seqdb_containers.Hash_algo.hash_algo
Query features of the file
val fadvise_wontneed : t -> unit
Tell the page cache that we won't need this file any more. Note that when writing, only synced pages are affected. The superblock is excluded from the advice.