Skip to navigation

aistore.sdk.obj.content_iterator.base

View as MarkdownOpen in Claude

Module Contents

Classes

NameDescription
BaseContentIterProviderAbstract base class for content iterator providers.
StreamBoundsByte positions of a single stream. A provider fills these in as it opens the stream,

API

class aistore.sdk.obj.content_iterator.BaseContentIterProvider(
chunk_size: int
)
Abstract

Abstract base class for content iterator providers.

Parameters:

client
ObjectClient

ObjectClient — Client for accessing contents of an individual object.

chunk_size
int

Size of each chunk of data yielded.

client
ObjectClient

Get the client associated with this content iterator.

aistore.sdk.obj.content_iterator.BaseContentIterProvider.create_iter(
offset: int = 0,
) -> typing.Generator[bytes, None, None]
abstract

Create an iterator over the object content.

Parameters:

offset
intDefaults to 0

The offset in bytes to apply. Defaults to 0.

bounds
StreamBoundsDefaults to None

StreamBounds — Receives the byte positions of the created stream. One provider can back several concurrent streams, so each caller that tracks positions must pass its own.

aistore.sdk.obj.content_iterator.BaseContentIterProvider.read_all() -> typing.Union[bytes, aistore.sdk.obj.content_iterator.buffer.ParallelBuffer]
abstract

Read all object content into memory and return it.

class aistore.sdk.obj.content_iterator.StreamBounds(
start: int = 0,
expected_end: typing.Optional[int] = None
)
Dataclass

Byte positions of a single stream. A provider fills these in as it opens the stream, so they are meaningful only once that stream yields or ends.

expected_end
Optional[int] = None

Logical byte position at EOF, when response metadata makes it known.

start
int = 0

Logical byte position at which the stream begins.