Skip to content

Commit

Permalink
Support to read chunk id in stream object.
Browse files Browse the repository at this point in the history
Signed-off-by: Ye Cao <[email protected]>
  • Loading branch information
dashanji committed Nov 15, 2024
1 parent 0f78867 commit fd895ed
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/vineyard/io/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ def __init__(self, client, stream: ObjectID, resolver=None):
self._resolver = resolver
self._client.open_stream(stream, 'r')

def next_chunk_id(self) -> ObjectID:
try:
return self._client.next_chunk_id(self._stream)
except StreamDrainedException as e:
raise StopIteration('No more chunks') from e

def next(self) -> object:
try:
chunk = self._client.next_chunk(self._stream)
Expand Down

0 comments on commit fd895ed

Please sign in to comment.