module Seqdb_fsys_ht:Filesystem implementation based on Kvseq and Hindex filessig..end
type ht_base
ht_base is a group of file systems residing in the same Unix
directorytype ht_file_descr
ht_file_descr file_system is the full type of the file systems
implemented heretype params = {
|
ht_inode_size : |
(* | ISZ (must be a multiple of 8) | *) |
|
ht_table_size : |
(* | HTSIZE in entries | *) |
|
ht_hash_algo : |
(* | HTALGO | *) |
|
ht_index_type : |
(* | Whether plain (CELLSZ=1) indexes or indexes with hash values (CELLSZ=2) are used | *) |
|
ht_have_dups : |
(* | HAVEDUPS | *) |
type stats = {
|
ht_table_total : |
(* | How many entries in the hash table are used | *) |
|
ht_table_del : |
(* | How many entries are marked as deleted | *) |
|
ht_data : |
(* | Total data space (used+dead), in bytes | *) |
|
ht_dead_data : |
(* | Dead (wasted) data space, in bytes | *) |
|
ht_used_data : |
(* | Used data space, in bytes | *) |
typeiterator_type =[ `Data | `Index ]
`Data: Base the iteration on the data file`Index: Base the iteration on the index fileexception Filesys_exists of string
exception Filesys_not_found of string
val new_base : string -> ht_baseGLOBAL.lock file.val lock_base : ht_base -> unit
Fails if there is no GLOBAL.lock file
val names : ht_base -> string list.data suffix)val base_dir : ht_base -> stringval create_filesys : ht_base ->
string ->
params ->
ht_file_descr Seqdb_fsys_types.file_systemFilesys_exists is raised.val get_filesys : ht_base ->
string -> ht_file_descr Seqdb_fsys_types.file_systemval check_filesys : ht_base -> string -> unitval configure_filesys : ?hindex_caching:bool ->
?data_caching:bool ->
?sync_every:int ->
?big_readahead:bool ->
?fully_buffered_index:bool -> ht_base -> string -> unithindex_caching: whether to allow page-caching of the idx file.
(true after create/get_filesys)data_caching: whether to allow page-caching of the data file.
(true after create/get_filesys)sync_every: after how many seconds files are synced to disk.
A negative value disables syncs. (600 after create/get_filesys)fully_buffered_index: The buffer for the index is made so large that
it can hold the whole index (false after create/get_filesys)val willneed_filesys : ht_base -> string -> unitval willneed_all_filesys : ht_base -> unitval check_all_filesys : ht_base -> unitval filesys_params : ht_base -> string -> paramsval dispose_all : ht_base -> unitval checkpoint_and_dispose_all : ?soft:bool -> ht_base -> unit
soft: if true, the checkpoint is only set if the last checkpoint is
too old
typededup_mode =[ `Indexcheck | `Off | `Twopass ]
HAVEDUPS. See
get_iteratorval get_iterator : ?at_filepos:string ->
?dedup_mode:dedup_mode ->
ht_base ->
string -> ht_file_descr Seqdb_fsys_types.file_system_iterator
at_filepos: If passed, the iteration starts at this file position
and not at the beginnning of the fsys.
dedup_mode: If the fsys has the HAVEDUPS feature, the question is
whether to detect duplicate entries and how:
`Off: Duplicates are not detected. This is the default.`Twopass: Two passes are made over the entries. In the first pass
it is recorded which entries exist where. In the second pass the
duplicate entries can be skipped. The advantage of this mode is that
there are no accesses to the index at all, and it can be used to
rebuild the index.`Indexcheck: For every entry it is checked whether it occurs
in the index. If so, the entry is returned, otherwise it is skipped.val get_idx_iterator : ht_base ->
string -> ht_file_descr Seqdb_fsys_types.file_system_iterator
Note that disposing and re-opening the filesystem is not supported
while the iterator is in use.
val get_stats : ht_base -> string -> statsval reindex : ?fault_tolerant:bool ->
?repair:bool ->
?itype:iterator_type ->
?fully_buffered_index:bool ->
ht_base -> string -> params -> boolReturns whether the new index replaced the previous one.
If fault_tolerant, errors are ignored, and the new index replaces the
current one even in case of errors.
If repair, invalid inodes are deleted in the data file. In any case,
they are not added to the new index.
The iterator type itype can be selected; it defaults to `Data.
A `Data iterator can be used to fill an empty index with the files
found in the data file. Furthermore, a `Data iterator is a good proof
whether the filesystem is in a consistent state. The `Index iterator
only visits the files that are in the old index. Generally, it is more
robust.
val compact : ?fault_tolerant:bool ->
?itype:iterator_type ->
?fully_buffered_index:bool ->
ht_base -> string -> params -> boolReturns whether the new files replaced the previous ones.
If fault_tolerant, errors are ignored, and the new files replace the
previous ones even in case of errors.
itype: See reindex.