aistore.sdk.obj.object_reader
aistore.sdk.obj.object_reader
Module Contents
Classes
API
Provide a way to read an object’s contents and attributes, optionally iterating over a stream of content.
Parameters:
Client for making requests to a specific object in AIS
Size of each data chunk to be fetched from the stream. Defaults to DEFAULT_CHUNK_SIZE.
If provided, use concurrent range-reads with this many workers.
Object metadata attributes.
Make a request to get a stream from the provided object and yield chunks of the stream content.
Returns: None
Generator[bytes, None, None]: An iterator over each chunk of bytes in the object
Use the object client to get a response from AIS and update the reader’s object attributes.
Parameters:
If True, use the requests library stream option to stream the response content.
Defaults to True.
Returns: requests.Response
The response object from the request.
Create a read-only, non-seekable ObjectFileReader instance for streaming object data in chunks.
This file-like object primarily implements the read() method to retrieve data sequentially,
with automatic retry/resumption in case of unexpected stream interruptions (e.g. ChunkedEncodingError,
ConnectionError) or timeouts (e.g. ReadTimeout).
Parameters:
Currently unused; retained for backward compatibility and future enhancements.
Total number of retry attempts allowed to resume the stream in case of interruptions. Defaults to 5.
Returns: BufferedIOBase
A read-only, non-seekable file-like object for streaming object content.
Raises:
ValueError: Ifmax_resumeis invalid (must be a non-negative integer).
Make a head request to AIS to update and return only object attributes.
Returns: ObjectAttributes
ObjectAttributes containing metadata for this object.
Return the raw byte stream of the object content.
Returns: Any
requests.Response.raw: Raw byte stream of the object content.
Read all object content into memory.
Returns: Union[bytes, ParallelBuffer]
When called without num_workers (single-stream GET).