module Nn_alloc_balanced:Block allocation algorithmsig
..end
val get_allocsize : int -> int
val allocate_balanced_strategy : inode:int64 ->
Nn_blockmap.blockmap_t list ->
Nn_alloc_types.transacted_datastores ->
< > ->
int ->
int64 ->
int ->
int -> string list -> Nn_blockmap.reserve_info -> Nn_blocklist.blocklist
allocate_balanced_strategy inode bmaps td owner repl index number bs pref
:
Allocates blocks for the index range index
to index+number-1
.
The replication factor is repl
. The blocks are allocated in the
passed blockmaps bmaps
, and will be assigned to owner
.
Tickets are generated for the transaction identified by td
.
In bs
the blocksize must be passed. The list pref
can contain
the identities of preferred datanodes; if possible blocks are
allocated there.
This algorithm allocates blocks in ranges, and tries to get a balanced allocation with respect to the datanodes.
May raise Nn_alloc_types.No_space
.