module Nn_db:sig
..end
class type ro_transaction =object
..end
class type transaction =object
..end
typeinodeinfo =
Pfs_rpcapi_aux.inodeinfo
type
allocinfo = {
|
ai_inode : |
(* | inode number | *) |
|
ai_index : |
(* | index position in the file | *) |
|
ai_identity : |
(* | identity of the datanode | *) |
|
ai_block : |
(* | block number of the datanode | *) |
val update_allocinfo : int64 ->
allocinfo list ->
Nn_blocklist.blocklist -> (string, allocinfo) Hashtbl.t
update_allocinfo inode ailist bilist
: Returns a hash table ht
which maps each datanode identity to the selected allocinfo block.
In ailist
the old list of allocinfo block is passed. This list
is updated with the information from bilist
, which are the
just allocated blocks.val init : Pfs_db.db_config -> Unixqueue.event_system -> unit
val ro_esys : unit -> Unixqueue.event_system
val commit_all_prepared_transactions : unit -> unit
val transact : Unixqueue.event_system -> int -> transaction
val ro_transact : unit -> ro_transaction Uq_engines.engine
val with_ro_trans : (Pfs_db.ro_async_connection -> Unixqueue.event_system -> 'a Uq_engines.engine) ->
'a Uq_engines.engine
with_ro_trans f
: Runs e = f conn esys
for a shared read-only
transaction and returns e
val datastore_list_e : Pfs_db.ro_async_connection ->
Unixqueue.event_system -> Nn_datastores.datastore list Uq_engines.engine
val datastore_list_ro_e : unit -> Nn_datastores.datastore list Uq_engines.engine
val datastore_find_e : identity:string ->
Pfs_db.ro_async_connection ->
Unixqueue.event_system -> Nn_datastores.datastore option Uq_engines.engine
val datastore_find_ro_e : identity:string -> Nn_datastores.datastore option Uq_engines.engine
val datastore_upd_e : id:int ->
identity:string ->
size:int64 ->
enabled:bool ->
Pfs_db.rw_async_connection ->
Unixqueue.event_system -> unit Uq_engines.engine
The blockalloc table is updated, too: For new stores, the rows are added. If the size of the existing store is increased, further rows are added.
It is an error to decrease the size.
val datastore_del_e : id:int ->
Pfs_db.rw_async_connection ->
Unixqueue.event_system -> unit Uq_engines.engine
typeds_init_source =
[ `Datastores of Nn_datastores.datastore list | `From_datastore_news_channel ]
val ds_cache_init : ds_init_source -> unit
`From_datastore_news_channel
: Calls Nn_datastore_news.list
to
get a list of datastores, and automatically fetches any updates.
This is the right setting for the coordinator.`Datastores l
: Uses the mapping l
. This is the right setting
for slavesdatastore_*
functions above do not
use the cache (they can be called to initialize the cache), and
also do neither set nor update the cache.val ds_cache_contents : unit -> Nn_datastores.datastore list
val revision_get_e : Pfs_db.ro_async_connection ->
Unixqueue.event_system -> string Uq_engines.engine
val revision_get_ro_e : unit -> string Uq_engines.engine
val revision_get_checksum_e : Pfs_db.ro_async_connection ->
Unixqueue.event_system -> string Uq_engines.engine
val revision_upd_e : revstr:string ->
commit_id:int ->
Pfs_db.rw_async_connection ->
Unixqueue.event_system -> unit Uq_engines.engine
val revision_clear_e : Pfs_db.rw_async_connection ->
Unixqueue.event_system -> unit Uq_engines.engine
val blockalloc_list_e : datastore:int ->
blkidx_min:int64 ->
blkidx_max:int64 ->
Pfs_db.ro_async_connection ->
Unixqueue.event_system -> (int64 * string) list Uq_engines.engine
datastore
ID. Returns the table
as pairs (blkidx,blkmap)
. Only pairs are returned with
blkidx_min <= blkidx <= blkidx_max
.val blockalloc_list_ro_e : datastore:int ->
blkidx_min:int64 ->
blkidx_max:int64 -> (int64 * string) list Uq_engines.engine
val blockalloc_upd_e : datastore:int ->
blkidx:int64 ->
blkmap:string ->
Pfs_db.rw_async_connection ->
Unixqueue.event_system -> unit Uq_engines.engine
blockalloc
tableval inode_listall_e : Pfs_db.ro_async_connection ->
Unixqueue.event_system -> int64 list Uq_engines.engine
val inode_get_e : id:int64 ->
Pfs_db.ro_async_connection ->
Unixqueue.event_system -> inodeinfo option Uq_engines.engine
val inode_get_ro_e : id:int64 -> inodeinfo option Uq_engines.engine
val inode_maxid_e : Pfs_db.ro_async_connection ->
Unixqueue.event_system -> int64 Uq_engines.engine
val inode_maxid_ro_e : unit -> int64 Uq_engines.engine
val inode_ins_e : id:int64 ->
inodeinfo ->
Pfs_db.rw_async_connection ->
Unixqueue.event_system -> unit Uq_engines.engine
inode
val inode_upd_e : id:int64 ->
inodeinfo ->
Pfs_db.rw_async_connection ->
Unixqueue.event_system -> unit Uq_engines.engine
inode
. filetype
cannot be updated, and changes are
silently ignored.val inode_upd_time_e : id:int64 ->
mtime:Pfs_rpcapi_aux.time option ->
ctime:Pfs_rpcapi_aux.time option ->
Pfs_db.rw_async_connection ->
Unixqueue.event_system -> unit Uq_engines.engine
val inode_set_anonymous_e : id:int64 ->
Pfs_db.rw_async_connection ->
Unixqueue.event_system -> unit Uq_engines.engine
anonymous
flag of the inodeval inode_del_e : id:int64 ->
Pfs_db.rw_async_connection ->
Unixqueue.event_system -> unit Uq_engines.engine
inode
val inode_get_anonymous_e : n:int ->
Pfs_db.ro_async_connection ->
Unixqueue.event_system -> int64 list Uq_engines.engine
n
inodes with set anonymous
fieldval inode_get_anonymous_ro_e : n:int -> int64 list Uq_engines.engine
val inodeblocks_get_e : inode:int64 ->
blkidx:int64 ->
len:int64 ->
Pfs_db.ro_async_connection ->
Unixqueue.event_system -> Nn_blocklist.blocklist Uq_engines.engine
inode
in the range from index
blkidx
to blkidx+len-1
.
Note that the returned blocks use an empty ticket not granting
any access!
val inodeblocks_get_ro_e : inode:int64 ->
blkidx:int64 -> len:int64 -> Nn_blocklist.blocklist Uq_engines.engine
val inodeblocks_getall_e : inode:int64 ->
dsid:int ->
Pfs_db.ro_async_connection ->
Unixqueue.event_system -> (int64 * int64 * int64) list Uq_engines.engine
(blkidx,block,length)
for this inode
and this datastore
dsid
(for fsck)val inodeblocks_del_e : inode:int64 ->
blkidx:int64 ->
len:int64 ->
Pfs_db.rw_async_connection ->
Unixqueue.event_system -> unit Uq_engines.engine
inode
in the range from index
blkidx
to blkidx+len-1
.val inodeblocks_ins_e : inode:int64 ->
Nn_blocklist.blocklist ->
Pfs_db.rw_async_connection ->
Unixqueue.event_system -> unit Uq_engines.engine
val allocinfo_get_e : inode:int64 ->
Pfs_db.rw_async_connection ->
Unixqueue.event_system -> allocinfo list Uq_engines.engine
val allocinfo_get_ro_e : inode:int64 -> allocinfo list Uq_engines.engine
val names_get_e : dir_inode:int64 ->
name:string ->
Pfs_db.ro_async_connection ->
Unixqueue.event_system -> int64 option Uq_engines.engine
val names_get_ro_e : dir_inode:int64 -> name:string -> int64 option Uq_engines.engine
val names_rev_get_e : inode:int64 ->
Pfs_db.ro_async_connection ->
Unixqueue.event_system -> (int64 * string) list Uq_engines.engine
val names_rev_get_ro_e : inode:int64 -> (int64 * string) list Uq_engines.engine
val names_get_parent_e : inode:int64 ->
Pfs_db.ro_async_connection ->
Unixqueue.event_system -> int64 option Uq_engines.engine
None
is returned.val names_get_parent_ro_e : inode:int64 -> int64 option Uq_engines.engine
val names_count_e : inode:int64 ->
Pfs_db.ro_async_connection -> Unixqueue.event_system -> int Uq_engines.engine
val names_count_ro_e : inode:int64 -> int Uq_engines.engine
val names_list_e : dir_inode:int64 ->
Pfs_db.ro_async_connection ->
Unixqueue.event_system -> (string * int64) list Uq_engines.engine
dir_inode
.
The contents are the member names and the inodes of the members.val names_list_ro_e : dir_inode:int64 -> (string * int64) list Uq_engines.engine
val names_ins_e : dir_inode:int64 ->
name:string ->
inode:int64 ->
Pfs_db.rw_async_connection ->
Unixqueue.event_system -> unit Uq_engines.engine
val names_del_e : dir_inode:int64 ->
name:string ->
Pfs_db.rw_async_connection ->
Unixqueue.event_system -> unit Uq_engines.engine
val admin_table_get_e : key:string ->
Pfs_db.ro_async_connection ->
Unixqueue.event_system -> string Uq_engines.engine
key
val admin_table_get_ro_e : key:string -> string Uq_engines.engine
val admin_table_exists_e : key:string ->
Pfs_db.ro_async_connection ->
Unixqueue.event_system -> bool Uq_engines.engine
val admin_table_exists_ro_e : key:string -> bool Uq_engines.engine
val admin_table_put_e : key:string ->
contents:string ->
Pfs_db.rw_async_connection ->
Unixqueue.event_system -> unit Uq_engines.engine
val read_ug_admin_e : Pfs_db.ro_async_connection ->
Unixqueue.event_system -> (string * string) list Uq_engines.engine
typemodification =
[ `Admin_table_put of string * string
| `Blockalloc_upd of int * int64 * string
| `Datastore_del of int
| `Datastore_upd of int * string * int64 * bool
| `Inode_del of int64
| `Inode_ins of int64 * inodeinfo
| `Inode_set_anonymous of int64
| `Inode_upd of int64 * inodeinfo
| `Inode_upd_time of
int64 * Pfs_rpcapi_aux.time option * Pfs_rpcapi_aux.time option
| `Inodeblocks_del of int64 * int64 * int64
| `Inodeblocks_ins of int64 * Nn_blocklist.blocklist
| `Names_del of int64 * string
| `Names_ins of int64 * string * int64
| `Revision_clear
| `Revision_upd of int * string ]
Nn_db
and Nn_slave
.val exec_e : modification ->
Pfs_db.rw_async_connection ->
Unixqueue.event_system -> unit Uq_engines.engine
val consistency_check_e : modification list ->
string ->
Pfs_db.rw_async_connection ->
Unixqueue.event_system -> unit Uq_engines.engine
The string is the name of the transaction.
If the check fails, the function enters error state