mstar.streaming.stream_buffer#
Classes
|
Per-request, per-edge buffer on the CONSUMER worker. |
|
A chunk of data popped from a StreamBuffer. |
- class mstar.streaming.stream_buffer.StreamBuffer(request_id, edge_name, from_partition, policy, _waiting_graph_edges=<factory>, _buffer=<factory>, _tensor_ids_in_order=<factory>, _id_to_tensor=<factory>, _consumed=0, _chunks_popped=0, producer_done=False)[source]#
Bases:
objectPer-request, per-edge buffer on the CONSUMER worker.
Tensors arrive one-by-one via normal RDMA routing. The buffer accumulates them and applies a ChunkPolicy to decide when the consuming node has enough data to proceed.
For sliding-window policies the buffer keeps old items so that pop_chunk can return the full window while only advancing by stride.
- Parameters:
- policy: ChunkPolicy#
- pop_chunk()[source]#
Pop the next chunk. Only call when has_chunk_ready() is True.
For sliding-window: returns window_size items, advances by stride items, discards items that have fallen out of the window. start_offset is the global position of the first item in the chunk.
- Return type: