AsyncFileReader

class hdfs_native.AsyncFileReader(inner: AsyncRawFileReader)

Bases: object

Attributes Summary

size

Methods Summary

close()

read([size])

Read up to size bytes from the file, or all content if -1

read_range(offset, len)

Read len bytes from the file starting at offset.

read_range_stream(offset, len)

Read len bytes from the file starting at offset as an iterator of bytes.

readable()

readall()

seek(offset[, whence])

Seek to offset relative to whence

seekable()

tell()

Attributes Documentation

size

Methods Documentation

async close() None
async read(size: int = -1) bytes

Read up to size bytes from the file, or all content if -1

async read_range(offset: int, len: int) bytes

Read len bytes from the file starting at offset. Doesn’t affect the position in the file

read_range_stream(offset: int, len: int) AsyncIterator[bytes]

Read len bytes from the file starting at offset as an iterator of bytes. Doesn’t affect the position in the file.

This is the most efficient way to iteratively read a file.

readable() bool
async readall() bytes
seek(offset: int, whence=0)

Seek to offset relative to whence

seekable()
tell() int