module Mapred_io_bgreader:sig
..end
Mapred_io
type
bgreader
val create : Mapred_fs.filesystem ->
string -> int64 -> int64 -> int -> bgreader
create fs name startblock endblock bufnum
The new reader uses a copy of the client fs
for the fs access.
The file is name
, which is read from startblock
to
endblock-1
. bufnum
is the length of the buffer in blocks
(for each of the two buffers, foreground and background).
After create
the first returned buffer
is empty. Call read
to read the first blocks.
val extend : bgreader -> int64 -> unit
extend bgreader endblock
: Sets a new endblock (higher value than the
old endblock)val read : bgreader -> int
read bgreader
: reads the next blocks into the buffer. Returns the
number of blocks - 0 if at eofval buffer : bgreader -> Netsys_mem.memory
read
is called.val buffer_block : bgreader -> int64
buffer
val buffer_len : bgreader -> int
buffer
in blocksval close : bgreader -> unit