hdfs::native::hadoopReadZero [] [src]

pub unsafe extern fn hadoopReadZero(file: *const hdfsFile, opts: *const hadoopRzOptions, maxLength: int32_t) -> *const hadoopRzBuffer

Perform a byte buffer read. If possible, this will be a zero-copy (mmap) read.

Params

Return

On success, we will return a new hadoopRzBuffer. This buffer will continue to be valid and readable until it is released by readZeroBufferFree. Failure to release a buffer will lead to a memory leak. You can access the data within the hadoopRzBuffer with hadoopRzBufferGet. If you have reached EOF, the data within the hadoopRzBuffer will be NULL. You must still free hadoopRzBuffer instances containing NULL.

On failure, we will return NULL plus an errno code. errno = EOPNOTSUPP indicates that we could not do a zero-copy read, and there was no ByteBufferPool supplied.